0

I'm running my Python script with 50 threads, therefore 50 chrome browsers will be open at any given time. The issue is, rarely, an unknown amount of browsers will get stuck - therefore limiting performance. And eventually, after a few hours, all browsers will end up being stuck. By stuck I assume, there has been an unforeseen error therefore the script is at a halt.

I've removed the headless flag and tried to diagnose said problems, but to no avail. Furthermore I've looked into killing threads/browsers which are open for longer than X amount of seconds but I can't seem to find anything simillar topics posted online. I've posted on Fiverr to seek paid help and all 7 people asked have no idea.

Ideally, if anybody knows how to check for browser alive time for each thread, and kill if it exceeds a set amount of seconds - would be greatly appreciated.

Tried: Contacting people for paid work on Fiverr.
Researching thoroughly on all forum threads.
(I didn't try to write code myself, as I'm inexperienced).

  • The WebDriver gets stuck due to an error, so if you can catch the exception and quit the WebDriver, that won't keep unnecessary chrome instances running. – Zero Jul 16 '23 at 13:38
  • It'd be more helpful if you can post the code snippet and any errors that you're facing. – Zero Jul 16 '23 at 13:39
  • Unfortunately there's no visible errors, nothing outputs to CMD and it's running in headless. I suspect, as my script requires proxies and has to deal with cloudflare turnstiles, that maybe either the proxy dies, or the captcha expires. @Zero – ManuelBerate Jul 16 '23 at 13:58
  • Exception handling will take care of that because it returns an error if a proxy isn't working or the WebDriver times out. You might be having something already to turn off the logging, as you're running 50 instances already. – Zero Jul 16 '23 at 14:24
  • Please provide enough code so others can better understand or reproduce the problem. – Community Jul 16 '23 at 14:48

0 Answers0