Open sunny9495-dev opened 2 years ago
It would help if your code was actually working :
.get()
to await and receive the actual resultnext_name()
should have 2 parameters.I would refrain from using globals, that's a catastrophe waiting to happen.
Anyway I don't understand why you need multiprocesses : you're nesting processes (undected-chromedriver spawns a Chrome process) and that's inefficient.
HI @sebdelsol
Iam trying to close all browser instance running by undetected chromedriver, as for example, i have shown it mate.
I tried
os.system("taskkill /F /IM chromedriver.exe /T")
But it suspend only chromedriver.exe, not the browser, where if we tried the same code with selenium, it suspends browser+chromedriver.exe , it works fine without any issue.
A selenium driver spawns the browser and closes it when quitting.
Undetected-chromedriver works differently : it spawns the browser first as a detached process before creating the driver. That's how you get a Chrome browser that has barely any link with it's driver hence hard to detect.
The browser is actually killed when the driver quit()
here or killed in this function registered in an atexit
hook if not.
So if you let the the processes finish everything will be cleanup.
If you want a quick exit you'll have to send a signal to your subprocesses to explicitly quit their drivers. It's the cleanest way otherwise you'll end up with temp directories not cleaned up.
btw you'd better use multithread instead of multiprocess since a driver is IO constrained and sits idle barely doing anything, it's more efficient and it's easier to share states and messages between your main thread and its children (you won't need to have pickeable objects).
@sebdelsol let me work on it. Thanks
Here is my program
When i click stop, the browser initialized by UC all have to get closed, but it isn't happening. When i selenium library, there is no issue
Any help would be appreciated.
Thanks