Open ultrafunkamsterdam opened 2 years ago
Any solutions?
i am stuck on this
To address the problem, you can modify the code as follows:
drivers = [
uc.Chrome(
version_main=114, # Specify your browser version
browser_executable_path="/path/of/chrome", # Provide the path of the Chrome browser
driver_executable_path="path/uc/driver", # Specify the path of the UC driver
)
for _ in range(135)
]
To obtain the path of the UC driver, run a single instance chrome using UC. It will create the driver in a specific directory based on your operating system:
Windows: ~/appdata/roaming/undetected_chromedriver
Linux: ~/.local/share/undetected_chromedriver
Adjust the paths accordingly based on your system configuration.
Actually there seems something wrong using
threading.threads and mp.processes, as well as asyncio or even in the main threadwhen creating multiple drivers.
I don't know why i even bother since creating multiple drivers is useless and solves no problems. chromedriver is just a messaging proxy passing messages back and forth. and 1 driver can control dozens of windows, each containing a magnitude of tabs (and is designed for that)
that having said
note: all the below has also been done using the (use_subprocess=True)
in Ipython this works fine:
however, when creating a file:
running this file yields:
thinking of a solution i tried modifying the code to put the path in a class variable when the first instance starts. but of course this won't work as it is not thread-safe.
workaround
So the ONLY solution for now (which is a bit cumbersome, so actually fits perfectly in creating multiple chromedrivers ;))
but does the job i :
putting the full path to your chrome BROWSER executable in the constructor
like so
Raising this as an issue since that is hip
(and I don't yet started documentation, nor know where to start, nor have time). so this is FYI