Closed nradosevic closed 1 year ago
Mhh from urllib.error.URLError: <urlopen error [Errno 2] No such file or directory: '/content/chromedriver_linux64.zip'>
it seemed to me like it's an issue with undetected-chromedriver itsself, but UserWarning: Patching undetected-chromedriver in non-google-colab
hint me to a bug in my code.
The "patch for google-colab" modified some code of undetected-chromedriver at selenium_profiles/utils/colab_utils.py#L67. The function was executed at selenium_profiles/driver.py#L53-L61
I wonder what happens, if:
pip unistall undetected-chromedriver -y; pip install undetected-chromedriver
) and then start with uc_driver=True
import undetected_chromedriver as uc
driver = uc.Chrome(use_subprocess=True, keep_alive=True)
driver.get('https://browserleaks.com/client-hints') # test client hints
input("Press ENTER to exit: ") driver.quit() # Execute on the End!
to confirm it isn't a issue with uc
Unfortanely, I dont't have a mac device aviable, but I anyways need to update some code for google-colab (which hopefully then resolves that issue).
The problem is indeed in the modified patcher.py from undetected chromedriver
After I replaced this line:
return urlretrieve('file:///content/chromedriver_linux64.zip', '/tmp/chromedriver_linux64.zip')[0]
whith this one:
return urlretrieve(u)[0]
everything worked as it's supposed to
The problem is indeed in the modified patcher.py from undetected chromedriver
Great, see the issue. I'll correct that in some time..
For now, I think if you allready have undeteced-chromedriver installed, Selenium-Profiles doesn't ever tries to patch automatically. ==> workaround
Thanks. That should do it for now. Better then manually fixing undetected chromedriver each time
Describe the bug I am getting an error 'No such file or directory: '/content/chromedriver_linux64.zip'>' when trying to use UC mode on MacOS
To Reproduce Try to run the example code using UC=True (tested on MacOS)
python-code
error-message
Environment (please complete the following information): MacOS Monterey
EDIT: It seems that the above error appears if you actaully tried running with UC flag set to false first and then changing to true. However, when you try to run the code with UC flag set to true from the beggining you face a different error: