Skip to content
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

allow downloading of recent versions of chrome #537

Conversation

david-engelmann
Copy link

the hosting path for chrome has changed for recent versions

@david-engelmann
Copy link
Author

need to patch File parsing of response, currently breaking because it's returning a file with .exe in the name

@david-engelmann
Copy link
Author

lets wait to merge, I'm still seeing some fails in CI/CD versions, I've almost resolved

@david-engelmann
Copy link
Author

I've tested my little heart out, and it seems to be working locally and within my CI/CD pipelines. We should run the testing suite to confirm everything is good to go

@david-engelmann
Copy link
Author

david-engelmann commented Jul 20, 2023

i adjusted so that the failing 114.0.5735.198 test pass

@tonycapone
Copy link

Hi @david-engelmann. Tried out your repo and branch to get around the url issue,
pip install git+https://github.com/david-engelmann/webdriver_manager.git@de-upgrade-chrome-version

But I get this error. Any ideas?

  File "/usr/local/lib/python3.10/site-packages/webdriver_manager/chrome.py", line 39, in install
    driver_path = self._get_driver_path(self.driver)
  File "/usr/local/lib/python3.10/site-packages/webdriver_manager/core/manager.py", line 30, in _get_driver_path
    file = self._download_manager.download_file(driver.get_driver_download_url())
  File "/usr/local/lib/python3.10/site-packages/webdriver_manager/drivers/chrome.py", line 63, in get_driver_download_url
    release_version = self.get_latest_patch_version_for_build_version(build_version=driver_version_to_download)
  File "/usr/local/lib/python3.10/site-packages/webdriver_manager/drivers/chrome.py", line 117, in get_latest_patch_version_for_build_version
    return data["builds"][build_version]["version"]
KeyError: '115.0.5790.102'

@david-engelmann
Copy link
Author

@tonycapone I believe that should work now

@SergeyPirogov
Copy link
Owner

Thanks @david-engelmann, could you add a specific test for chrome v115?

@SergeyPirogov
Copy link
Owner

I've merged fixes for chrome. Please test and provide a feedback

@david-engelmann
Copy link
Author

Thanks @david-engelmann, could you add a specific test for chrome v115?

@SergeyPirogov It's unclear how I define test cases for certain chrome versions. the test failing on 114 is because that version (114.0.5735.198) doesn't exist. I was looking at your merge conflicts and I couldn't follow the logic for most of them. In particular, the removal of support for the short form version 115 and the build version 115.0.5735 etc. I can remove that logic but it will require users to use the patched version of their browser which changes frequently.

@SergeyPirogov
Copy link
Owner

@david-engelmann I've fixed this in github actions by installing latest Google Chrome for every os

@david-engelmann
Copy link
Author

@SergeyPirogov Perfect! I adjusted the parameters and os_type logic. The only conflict I left in was the short form support for version xxx and version xxx.x.xxxx.

@SergeyPirogov
Copy link
Owner

@david-engelmann please point to exect lines of code, because its hard to get what do you mean by short version


raise Exception(f"No such driver version {browser_version} for {platform}")
def get_latest_release_for_version(self, version):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SergeyPirogov Here is the function for latest release by short version ie. 115

return v
return None

def get_latest_patch_version_for_build_version(self, build_version):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SergeyPirogov Here is the function for latest release by build version ie. 115.0.5735

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, why do we need it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SergeyPirogov The old LATEST_RELEASE url supported those style lookups. ie. https://chromedriver.storage.googleapis.com/LATEST_RELEASE_113 and https://chromedriver.storage.googleapis.com/LATEST_RELEASE_114.0.5735. It was suggested we retain that for versions over 115. Without that, users will have to pass in the full browser version ie. version="114.0.5735.90", which can change frequently. Either way, I'm fine including for backwards compatibility, I'm fine with removing for simplicity and add an exception that explains as suggested by you

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd postpone this, because what I see know is that browser version is equal to the one mentioned in their driver website. Moreover I think that fix should be applied in method get_url_for_version_and_platform

@david-engelmann
Copy link
Author

Code merged in #539

@david-engelmann
Copy link
Author

going to close out and submit a new pr for the short version support feature discussed here

@p112913
Copy link

p112913 commented Jul 22, 2023

Thanks @david-engelmann for all your hard work on this PR!

@grapefruiteater
Copy link

Sorry, Chrome changed driver url path.
https://googlechromelabs.github.io/chrome-for-testing/

please re-revise content.

@grapefruiteater
Copy link

This is my error. Driver path 115.0.5790.110 is not valid from above URL site.

Traceback (most recent call last):
File "C:\Users\11235\Documents\Workfolder\Amazon_GetOrders\Amazon_GetOrders.py", line 73, in
driver_path = ChromeDriverManager().install()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\11235\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\chrome.py", line 39, in install
driver_path = self._get_driver_binary_path(self.driver)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\11235\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\core\manager.py", line 33, in _get_driver_binary_path
file = self._download_manager.download_file(driver.get_driver_download_url())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\11235\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\drivers\chrome.py", line 59, in get_driver_download_url
modern_version_url = self.get_url_for_version_and_platform(driver_version_to_download, os_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\11235\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\drivers\chrome.py", line 94, in get_url_for_version_and_platform
raise Exception(f"No such driver version {browser_version} for {platform}")
Exception: No such driver version 115.0.5790.110 for win32

@david-engelmann
Copy link
Author

@grapefruiteater It appears that the version of Chrome you have is not supported by chrome-for-testing

@Derpitron
Copy link

@grapefruiteater It appears that the version of Chrome you have is not supported by chrome-for-testing

I am experiencing this issue as well. How can I fix it?

@david-engelmann
Copy link
Author

@Derpitron I would install a version of chrome that matches a version supported by chrome-for-testing. This link shows everything they support. The main issue is the patch version -> 115.0.5790.110. 102 is the last version supported by google-for-testing

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.