Open ggnetoo opened 11 months ago
It seems that version 118 is not yet supported, perhaps you need to go back to version 117
Fixed on mac by switching to beta release on OSX.
Change browser binary path in candidates.update method call line 879 inside undected_chromedriver init.py file to "/Applications/Google Chrome Beta.app/Contents/MacOS/Google Chrome Beta".
Hope it work for you too 🤟
I also had this issue. After debugging I found if there is chromedriver binary available in patcher.data_path
location, it will always pick that even though you set driver_executable_path=ChromeDriverManager().install()
.
@faizanalhassan Can you explain your fix in more words?
So, recently in a project I was using undetected-chromedriver and it was giving me an error that chromedriver.exe version is 114. I rechecked my chromedriver.exe was 118 and I was passing its path correctly through driver_executable_path
parameter. So, I debugged the library code to review where the executable_path is updated.
During debugging, I noticed that these lines are causing the problem:
So, even user has given a custom chromedriver path, it will always first check patcher.data_path
directory. And if found chromedriver binary it will set that as executable path (self.executable_path = str(most_recent)
).
I removed all chromedriver binaries from that path and then my custom path was correctly used and no error was raised.
I think the solution is to move the below lines to the top of this method. https://github.com/ultrafunkamsterdam/undetected-chromedriver/blob/cea80717c5a3d95ccf5c40e6e38081d5454ec7a5/undetected_chromedriver/patcher.py#L147-L152
Created a PR #1638 to fix this. Please check if works.
Tried update Webdriver + Selenium too, but the error persists after update Chrome to version 118.