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

DriverCacheManager._cache_key_driver_version is unused #661

Open
GaspardCulis opened this issue Jul 9, 2024 · 1 comment
Open

DriverCacheManager._cache_key_driver_version is unused #661

GaspardCulis opened this issue Jul 9, 2024 · 1 comment

Comments

@GaspardCulis
Copy link

The DriverCacheManager initializes its _cache_key_driver_version to None, and it never gets updated in the code. This means that even with a DriverCacheManager you still have to fetch the remote driver version which can lead to API rate limit errors.

To avoid running into these kinds of issues when having to run GeckoDriverManager().install() multiple times I'm currently using this dirty workaround:

from webdriver_manager.firefox import GeckoDriverManager
from webdriver_manager.core.driver_cache import DriverCacheManager

cache = DriverCacheManager()
cache._cache_key_driver_version = "v0.34.0"
driver_path = GeckoDriverManager(cache_manager=cache).install()

But it's not ideal. I guess the DriverCacheManager should assume that the desired driver version is the OS browser version (get_browser_version_from_os)

@izharus
Copy link

izharus commented Aug 10, 2024

I noticed the same thing. The install() method, therefore, always requires network access. Perhaps it would be worth adding another method alongside install(), such as get_cached_binary(), which would simply extract the latest driver from the cache? To achieve this, we only need to implement one method in DriverCacheManager, I can do it.

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

No branches or pull requests

2 participants