-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for downloading Chromedriver versions 115+ #1478
Add support for downloading Chromedriver versions 115+ #1478
Conversation
Extracting just one file that was in a directory caused an error on Windows. Extracting all fixes this issue.
If anyone wants to test this change out, you can install this fork through pip: pip install -e git+https://github.com/jdholtz/undetected-chromedriver.git@29551bd27954dacaf09864cf77935524db642c1b#egg=undetected_chromedriver Note: If you get errors while installing the above, try to add single quotes around the URL (specifically for Zsh shells). Also, make sure you have Git installed Also, make sure you have uninstalled the original |
How to use this correctly? any example code?
|
@azorkai, just install it with the pip command I provided above and use this library as you normally would |
Already tried that but got this error;
|
Can you provide the exact code you are using? Also, do you get the same error when you use Chrome v114 or lower with the original v3.5.2 of undetected_chromedriver (not this fork)? I'm fairly certain the |
Works fine for me. The error sounds like a DNS resolution error. |
On Mac M1 (ARM), getting this error
On my machine, |
@neekrom, that line was actually totally wrong. The new commit should fix it. Did this ever work on your ARM machine before? There didn't seem to be code that would download the Chromedriver for ARM before this PR. I edited the pip install command above to point to the latest fix |
@jdholtz I've actually never used this package before. I just tried it out today but found the ChromeDriver and browser version mismatch error, so tried this branch. Now I'm getting a different error:
It looks like you're referencing |
Ha, I guess that's what I get for not testing. It should be good now. |
Also on Mac M1 (ARM), getting this error after the latest fix:
|
@matthewngc what does If you download and extract the chromedriver from this URL (should be Binary: chromedriver, Platform: mac-arm64), and then set that chromedriver as your |
I pointed
|
Also tried setting the downloaded chromedriver as the |
Strange. Does the x64 version work for you guys? |
Apparently the x64 version works on ARM devices with Mac, so the platform now just chooses the correct platform name based on the Chromedriver version requested
yes x64 works. This issue seems to be unrelated to this PR, but unique to mac arm64 only which leads to a still open issue months ago #947 |
I just removed support for downloading the ARM chromedriver since it doesn't seem to work. It appears that Rosetta can be installed on ARM Macs (if you are still running into issues) which will bring compatibility for the x64 chromedriver |
any updates on this guys ? I dont want to downgrade my chrome selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:53658 |
getting this error with your branch @jdholtz
ModuleNotFoundError: No module named 'undetected_chromedriver' regular pip install undetected-chromedriver does not result in the same error |
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:53658
Windows 10, x64. I installed it with your command and see this error. Is it needed to edit something else? I think after that I have two installed versions of driver and script use old, not your fork. |
Can we try this PR with Mac m2 arm? |
If I start chrome manually, I can load https pages. If I start chrome with UC (driver = Chrome(options=options, driver_executable_path="C:\Users\data\Desktop\chromedriver.exe")) I cannot browse to any https sites. |
@charlbury if you can reproduce this issue when you download the driver manually, that means this PR does not have to do with the issue you face. Are you using any other libraries with undetected_chromedriver such as selenium-wire? |
Yes, we are using selenium-wire but thought that
Is there another step we need to take at the moment to have bot work? |
@charlbury Selenium wire is not compatible with later versions of Selenium and UC. I have a PR to fix this issue in this repository and Selenium wire. For now, you can add this line |
Thank you for the update / fix. Much appreciated. uninstalled the old UC and ran the command provided above - it worked today 8/24/23 |
That fixed the problem for me. Cheers! |
This is currently working on my Chrome v116 setup. Thank you! |
@jdholtz would u be able to tell me what's the solution for it so far? |
@jdholtz would be happy to merge, however we could get rid of the old way all together as they have endpoints for all versions as well. Is this working for both Intel and arm macs too? |
01417d0
into
ultrafunkamsterdam:master
I merged it anyway! new version = 3.5.3 also available from pypi! Thanks @jdholtz |
Hi Anyone using selenium java and facing issue on chrome 116.0.5845.111? |
I am still facing the same issue with chrome driver version. I built an executable with pyinstaller, in my local machine it runs normally, but when I run the build and run the executable, it returns to me the same error
Error above |
I looked at their website here as well as their JSON endpoints and it says Chromedriver is "supported since v115.0.5763.0" so I don't believe the endpoint has older versions as well (older versions also don't show up in the
People have had mixed results with this. I believe it works fine on Intel macs. This comment says that it works on his ARM mac. However, people have had issues installing the driver manually (not using this PR) and attempting to get it to work so I don't exactly know what is going on (maybe they need Rosetta?). Edit: I also got confirmation from someone on ARM Mac using my own project that includes v3.5.3 that it works for them |
@Kayquedias did you try with undetected_chromedriver v3.5.3? |
@@ -72,6 +62,10 @@ def __init__( | |||
prefix = "undetected" | |||
self.user_multi_procs = user_multi_procs | |||
|
|||
self.is_old_chromedriver = version_main and version_main <= 114 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ultrafunkamsterdam Did you get this error?
File "C:\hostedtoolcache\windows\Python\3.7.9\x64\lib\site-packages\undetected_chromedriver\__init__.py", line 255, in __init__
user_multi_procs=user_multi_procs,
File "C:\hostedtoolcache\windows\Python\3.7.9\x64\lib\site-packages\undetected_chromedriver\patcher.py", line 65, in __init__
self.is_old_chromedriver = version_main and version_main <= 114
TypeError: '<=' not supported between instances of 'str' and 'int'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you passing version_main in as a string? It is supposed to be None
or an int
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jdholtz Thanks for your quick reply. I didn't notice the type at the beginning.
Sorry to bother and thanks for your amazing effort and help. It create an src folder within my project and then how do i use it? |
@spacb this PR is now included in the v3.5.3 of this library, so just do |
Ok thanks I will try that and see how to get it to work. |
I’ve been experiencing the same issues. This fixed it for me. |
Hi, does anyone have solution for this issue ? |
Hi we cannot help you with that here, this is a discussion box for a PR about fixing an issue on |
I now get this error with version 3.5.3: |
I've ugraded my chrome version (manually from browser menu) to 117 and problem is solved |
If we updated uc to use the Selenium Manager is Selenium 4.12.0 it'll resolve this issue |
Fixes #1475, #1477, and #1434
This PR adds support for downloading Chromedriver versions 115+. This is necessary due to the Chromium team's change to Chromedriver's release process (see here).
If the
version_main
is 114 or older, the Chromedriver will still be downloaded usingLATEST_RELEASE_{version}
. If theversion_main
is specified and is 115+, the/latest-versions-per-milestone-with-downloads.json
from the new JSON endpoint is used and the version is selected from the corresponding milestone. Last, if theversion_main
is not specified, the/last-known-good-versions-with-downloads.json
endpoint is used to fetch the latest stable version.In contrast with #1427, this PR uses the new JSON endpoints instead of reverting back to old versions if the
LATEST_RELEASE
endpoint isn't found (causing version discrepancy errors).I also added compatibility for installingIt has been tested on Linux, Windows, and Mac with success. The Chromedriver doesn't work on ARM devices when downloading the ARM chromedriver, but it seems to work fine with the x64 version (possibly with Rosetta installed).x86
andarm64
for Mac separately since the platform names changed for the new endpoints. However, I have only tested on Linux and Windows so it would be great if someone could test on Mac (x86 and ARM)This also allows for users to download the Dev and Beta versions (currently 117 and 118) if they specify it using
version_main
.