Skip to content

Conversation

@anilabhadatta
Copy link

adding a binary_location, the browser didn't get the version correctly in windows and a new browser window was popping up.
this fix should add a method to get the version correctly.

A request or a doubt:
Is it possible to give a chromedriver path while creating a driver obj?
self.browser = Driver(undetectable=True, user_data_dir=self.userDataDir, binary_location=constants.chromeBinaryPath, driver_version=117)
I have a project (educative.io_scraper) I already have a feature to download the chromedriver, so I wanted to know if there is any way to provide the path to chromedriver. After that it can be patched and the uc_driver could be saved in the same folder location?

@mdmintz
Copy link
Member

mdmintz commented Mar 15, 2024

Thanks for finding the issue. It's resolved in 4.24.7 - https://github.com/seleniumbase/SeleniumBase/releases/tag/v4.24.7
I fixed it differently: 9a9c253

To answer your separate question, the uc_driver must be placed in the seleniumbase/drivers/ folder. If it's not there, chromedriver will be downloaded automatically, converted into uc_driver, and placed into that folder.

@mdmintz mdmintz closed this Mar 15, 2024
@anilabhadatta
Copy link
Author

@mdmintz thanks, I will check if this is working for all OS.
I was planning to implement SeleniumBase in my project

@anilabhadatta
Copy link
Author

@mdmintz I have tested 4.24.8
image

self.browser = Driver(undetectable=True, user_data_dir=self.userDataDir, binary_location=constants.chromeBinaryPath)
the chrome that I would like to test is of version 117
but when I try to load a chromebrowser, it downloaded a v122 chromedriver.
I am confused how did chrome even launched with a v122 chromedriver.
If I add version_main=117 parameter while loading driver then the driver is downloaded as per the chrome's version.
What I think is, selenium base is unable to get the chrome version so the driver is downloaded as per the chrome installed in system's path instead of a custom path provided for chrome binary.

Secondly the version detection system failed again in Windows, I think you may need to use my solution since in Windows it is not possible to get version using --version flag, It may be applicable for Mac and Linux but in Windows you will require to use powershell.

I added the powershell solution and removed version_main, the correct chromedriver was downloaded and chrome loaded properly as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants