Skip to content

Commit

Permalink
Fix caching of chromedriver in start_chrome(...)
Browse files Browse the repository at this point in the history
  • Loading branch information
mherrmann committed Aug 3, 2023
1 parent 821b16c commit c4d7998
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
author = 'Michael Herrmann'

# Also update ../setup.py when you change this:
release = '3.2.4'
release = '3.2.5'


# -- General configuration ---------------------------------------------------
Expand Down
8 changes: 8 additions & 0 deletions helium/_impl/chromedriver.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.core.driver_cache import DriverCacheManager

import webdriver_manager

# Work around a bug in webdriver_manager:
if webdriver_manager.__version__ == '4.0.0':
class DriverCacheManager(DriverCacheManager):
def __get_metadata_key(self, driver):
super().__get_metadata_key(driver)
return self._metadata_key

def install_matching_chromedriver(cache_dir=None):
manager = ChromeDriverManager(cache_manager=DriverCacheManager(cache_dir))
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ selenium==3.141.0
# Selenium 3 is incompatible with urllib3 >= 2:
urllib3<2

webdriver-manager==4.0.0
webdriver-manager>=4.0.0
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup(
name = 'helium',
# Also update docs/conf.py when you change this:
version = '3.2.4',
version = '3.2.5',
author = 'Michael Herrmann',
author_email = '[email protected]',
description = 'Lighter browser automation based on Selenium.',
Expand All @@ -16,7 +16,7 @@
'selenium==3.141.0',
# Selenium 3 is incompatible with urllib3 >= 2:
'urllib3<2',
'webdriver-manager==4.0.0'
'webdriver-manager>=4.0.0'
],
package_data = {
'helium._impl': ['webdrivers/**/*']
Expand Down

0 comments on commit c4d7998

Please sign in to comment.