{"id":13585170,"url":"https://github.com/SergeyPirogov/webdriver_manager","last_synced_at":"2025-04-07T06:32:44.569Z","repository":{"id":37550031,"uuid":"77217599","full_name":"SergeyPirogov/webdriver_manager","owner":"SergeyPirogov","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-18T09:07:45.000Z","size":577,"stargazers_count":2126,"open_issues_count":45,"forks_count":467,"subscribers_count":32,"default_branch":"master","last_synced_at":"2025-03-24T09:08:34.339Z","etag":null,"topics":["python","selenium","webdriver","webdrivermanager"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SergeyPirogov.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":"automation_remarks","open_collective":null,"ko_fi":null,"tidelift":null,"custom":null}},"created_at":"2016-12-23T10:16:45.000Z","updated_at":"2025-03-14T14:07:41.000Z","dependencies_parsed_at":"2023-02-16T06:25:15.258Z","dependency_job_id":"2b007b58-1fc1-4015-8e4d-f5c50d4e2247","html_url":"https://github.com/SergeyPirogov/webdriver_manager","commit_stats":{"total_commits":476,"total_committers":69,"mean_commits":6.898550724637682,"dds":0.796218487394958,"last_synced_commit":"e73a1cc77845e9372aefa11715e700799d93413b"},"previous_names":[],"tags_count":65,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SergeyPirogov%2Fwebdriver_manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SergeyPirogov%2Fwebdriver_manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SergeyPirogov%2Fwebdriver_manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SergeyPirogov%2Fwebdriver_manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SergeyPirogov","download_url":"https://codeload.github.com/SergeyPirogov/webdriver_manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423513,"owners_count":20936626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","selenium","webdriver","webdrivermanager"],"created_at":"2024-08-01T15:04:46.717Z","updated_at":"2025-04-07T06:32:44.561Z","avatar_url":"https://github.com/SergeyPirogov.png","language":"Python","readme":"# Webdriver Manager for Python\n\n[![Tests](https://github.com/SergeyPirogov/webdriver_manager/actions/workflows/test.yml/badge.svg)](https://github.com/SergeyPirogov/webdriver_manager/actions/workflows/test.yml)\n[![PyPI](https://img.shields.io/pypi/v/webdriver_manager.svg)](https://pypi.org/project/webdriver-manager)\n[![Supported Python Versions](https://img.shields.io/pypi/pyversions/webdriver_manager.svg)](https://pypi.org/project/webdriver-manager/)\n[![codecov](https://codecov.io/gh/SergeyPirogov/webdriver_manager/branch/master/graph/badge.svg)](https://codecov.io/gh/SergeyPirogov/webdriver_manager)\n\n**Because of the War in Ukraine the project is on hold😔**\n\nNow it's time to produce FPV drone for Ukrainian army.\n\nSupport via paypal: semen4ik20@gmail.com\n\n## Support the library on [Patreon](https://www.patreon.com/automation_remarks)\n\nThe main idea is to simplify management of binary drivers for different browsers.\n\nFor now support:\n\n- [ChromeDriver](#use-with-chrome)\n- [EdgeChromiumDriver](#use-with-edge)\n- [GeckoDriver](#use-with-firefox)\n- [IEDriver](#use-with-ie)\n- [OperaDriver](#use-with-opera)\n\nCompatible with Selenium 4.x and below.\n\nBefore:\nYou need to download the chromedriver binary, unzip it somewhere on your PC and set the path to this driver like this:\n\n```python\nfrom selenium import webdriver\ndriver = webdriver.Chrome('/home/user/drivers/chromedriver')\n```\n\nIt’s boring!!! Moreover, every time a new version of the driver is released, you need to repeat all these steps again and again.\n\nWith webdriver manager, you just need to do two simple steps:\n\n#### Install manager:\n\n```bash\npip install webdriver-manager\n```\n\n#### Use with Chrome\n\n```python\n# selenium 3\nfrom selenium import webdriver\nfrom webdriver_manager.chrome import ChromeDriverManager\n\ndriver = webdriver.Chrome(ChromeDriverManager().install())\n```\n```python\n# selenium 4\nfrom selenium import webdriver\nfrom selenium.webdriver.chrome.service import Service as ChromeService\nfrom webdriver_manager.chrome import ChromeDriverManager\n\ndriver = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install()))\n```\n\n#### Use with Chromium\n\n```python\n# selenium 3\nfrom selenium import webdriver\nfrom webdriver_manager.chrome import ChromeDriverManager\nfrom webdriver_manager.core.os_manager import ChromeType\n\ndriver = webdriver.Chrome(ChromeDriverManager(chrome_type=ChromeType.CHROMIUM).install())\n```\n\n```python\n# selenium 4\nfrom selenium import webdriver\nfrom selenium.webdriver.chrome.service import Service as ChromiumService\nfrom webdriver_manager.chrome import ChromeDriverManager\nfrom webdriver_manager.core.os_manager import ChromeType\n\ndriver = webdriver.Chrome(service=ChromiumService(ChromeDriverManager(chrome_type=ChromeType.CHROMIUM).install()))\n```\n\n#### Use with Brave\n\n```python\n# selenium 3\nfrom selenium import webdriver\nfrom webdriver_manager.chrome import ChromeDriverManager\nfrom webdriver_manager.core.os_manager import ChromeType\n\ndriver = webdriver.Chrome(ChromeDriverManager(chrome_type=ChromeType.BRAVE).install())\n```\n\n```python\n# selenium 4\nfrom selenium import webdriver\nfrom selenium.webdriver.chrome.service import Service as BraveService\nfrom webdriver_manager.chrome import ChromeDriverManager\nfrom webdriver_manager.core.os_manager import ChromeType\n\ndriver = webdriver.Chrome(service=BraveService(ChromeDriverManager(chrome_type=ChromeType.BRAVE).install()))\n```\n\n\n#### Use with Edge\n\n```python\n# selenium 3\nfrom selenium import webdriver\nfrom webdriver_manager.microsoft import EdgeChromiumDriverManager\n\ndriver = webdriver.Edge(EdgeChromiumDriverManager().install())\n```\n```python\n# selenium 4\nfrom selenium import webdriver\nfrom selenium.webdriver.edge.service import Service as EdgeService\nfrom webdriver_manager.microsoft import EdgeChromiumDriverManager\n\ndriver = webdriver.Edge(service=EdgeService(EdgeChromiumDriverManager().install()))\n```\n\n#### Use with Firefox\n\n```python\n# selenium 3\nfrom selenium import webdriver\nfrom webdriver_manager.firefox import GeckoDriverManager\n\ndriver = webdriver.Firefox(executable_path=GeckoDriverManager().install())\n```\n```python\n# selenium 4\nfrom selenium import webdriver\nfrom selenium.webdriver.firefox.service import Service as FirefoxService\nfrom webdriver_manager.firefox import GeckoDriverManager\n\ndriver = webdriver.Firefox(service=FirefoxService(GeckoDriverManager().install()))\n```\n\n#### Use with IE\n\n```python\n# selenium 3\nfrom selenium import webdriver\nfrom webdriver_manager.microsoft import IEDriverManager\n\ndriver = webdriver.Ie(IEDriverManager().install())\n```\n```python\n# selenium 4\nfrom selenium import webdriver\nfrom selenium.webdriver.ie.service import Service as IEService\nfrom webdriver_manager.microsoft import IEDriverManager\n\ndriver = webdriver.Ie(service=IEService(IEDriverManager().install()))\n```\n\n\n#### Use with Opera\n\n```python\n# selenium 3\nfrom selenium import webdriver\nfrom selenium.webdriver.chrome import service\nfrom webdriver_manager.opera import OperaDriverManager\n\nwebdriver_service = service.Service(OperaDriverManager().install())\nwebdriver_service.start()\n\ndriver = webdriver.Remote(webdriver_service.service_url, webdriver.DesiredCapabilities.OPERA)\n```\n```python\n# selenium 4\nfrom selenium import webdriver\nfrom selenium.webdriver.chrome import service\nfrom webdriver_manager.opera import OperaDriverManager\n\nwebdriver_service = service.Service(OperaDriverManager().install())\nwebdriver_service.start()\n\noptions = webdriver.ChromeOptions()\noptions.add_experimental_option('w3c', True)\n\ndriver = webdriver.Remote(webdriver_service.service_url, options=options)\n```\n\nIf the Opera browser is installed in a location other than `C:/Program Files` or `C:/Program Files (x86)` on Windows\nand `/usr/bin/opera` for all unix variants and mac, then use the below code,\n\n```python\noptions = webdriver.ChromeOptions()\noptions.binary_location = \"path/to/opera.exe\"\ndriver = webdriver.Remote(webdriver_service.service_url, options=options)\n```\n\n#### Get browser version from path\n\nTo get the version of the browser from the executable of the browser itself:\n\n```python\nfrom webdriver_manager.firefox import GeckoDriverManager\n\nfrom webdriver_manager.core.utils import read_version_from_cmd \nfrom webdriver_manager.core.os_manager import PATTERN\n\nversion = read_version_from_cmd(\"/usr/bin/firefox-bin --version\", PATTERN[\"firefox\"])\ndriver_binary = GeckoDriverManager(version=version).install()\n```\n\n#### Custom Cache, File manager and OS Manager\n\n```python\nfrom webdriver_manager.chrome import ChromeDriverManager\nfrom webdriver_manager.core.file_manager import FileManager\nfrom webdriver_manager.core.driver_cache import DriverCacheManager\nfrom webdriver_manager.core.os_manager import OperationSystemManager\n\ncache_manager = DriverCacheManager(file_manager=FileManager(os_system_manager=OperationSystemManager()))\nmanager = ChromeDriverManager(cache_manager=cache_manager)\nos_manager = OperationSystemManager(os_type=\"win64\")\n```\n\n## Configuration\n\n**webdriver_manager** has several configuration variables you can be interested in.\nAny variable can be set using either .env file or via python directly\n\n### `GH_TOKEN`\n**webdriver_manager** downloading some webdrivers from their official GitHub repositories but GitHub has [limitations](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting) like 60 requests per hour for unauthenticated users.\nIn case not to face an error related to GitHub credentials, you need to [create](https://help.github.com/articles/creating-an-access-token-for-command-line-use) GitHub token and place it into your environment: (\\*)\n\nExample:\n\n```bash\nexport GH_TOKEN = \"asdasdasdasd\"\n```\n\n(\\*) access_token required to work with GitHub API [more info](https://help.github.com/articles/creating-an-access-token-for-command-line-use/).\n\nThere is also possibility to set same variable via ENV VARIABLES, example:\n\n```python\nimport os\n\nos.environ['GH_TOKEN'] = \"asdasdasdasd\"\n```\n\n### `WDM_LOG`\nTurn off webdriver-manager logs use:\n\n```python\nimport logging\nimport os\n\nos.environ['WDM_LOG'] = str(logging.NOTSET)\n```\n\n### `WDM_LOCAL`\nBy default, all driver binaries are saved to user.home/.wdm folder. You can override this setting and save binaries to project.root/.wdm.\n\n```python\nimport os\n\nos.environ['WDM_LOCAL'] = '1'\n```\n\n### `WDM_SSL_VERIFY`\nSSL verification can be disabled for downloading webdriver binaries in case when you have troubles with SSL Certificates or SSL Certificate Chain. Just set the environment variable `WDM_SSL_VERIFY` to `\"0\"`.\n\n```python\nimport os\n\nos.environ['WDM_SSL_VERIFY'] = '0'\n```\n\n### `version`\nSpecify the version of webdriver you need. And webdriver-manager will download it from sources for your os.\n```python\nfrom webdriver_manager.chrome import ChromeDriverManager\n\nChromeDriverManager(driver_version=\"2.26\").install()\n```\n\n### `cache_valid_range`\nDriver cache by default is valid for 1 day. You are able to change this value using constructor parameter:\n\n```python\nfrom webdriver_manager.chrome import ChromeDriverManager\nfrom webdriver_manager.core.driver_cache import DriverCacheManager\n\nChromeDriverManager(\"2.26\", cache_manager=DriverCacheManager(valid_range=1)).install()\n```\n\n### `os_type`\nFor some reasons you may use custom OS/arch. You are able to change this value using constructor parameter:\n\n```python\nfrom webdriver_manager.chrome import ChromeDriverManager\nfrom webdriver_manager.core.os_manager import OperationSystemManager\n\nChromeDriverManager(os_system_manager=OperationSystemManager(os_type=\"linux-mips64\")).install()\n```\n\n### `url`\nYou may use any other repo with drivers and release URl. You are able to change this value using constructor parameters:\n\n```python\nfrom webdriver_manager.chrome import ChromeDriverManager\n\nChromeDriverManager(url=\"https://custom-repo.url\", latest_release_url=\"https://custom-repo.url/LATEST\").install()\n```\n\n---\n\n### Custom Logger\n\nIf you need to use a custom logger, you can create a logger and set it with `set_logger()`.\n\n```python\nimport logging\nfrom webdriver_manager.core.logger import set_logger\n\nlogger = logging.getLogger(\"custom_logger\")\nlogger.setLevel(logging.DEBUG)\nlogger.addHandler(logging.StreamHandler())\nlogger.addHandler(logging.FileHandler(\"custom.log\"))\n\nset_logger(logger)\n```\n\n---\n\n### Custom HTTP Client\nIf you need to add custom HTTP logic like session or proxy you can define your custom HttpClient implementation.\n\n```python\nimport os\n\nimport requests\nfrom requests import Response\n\nfrom webdriver_manager.chrome import ChromeDriverManager\nfrom webdriver_manager.core.download_manager import WDMDownloadManager\nfrom webdriver_manager.core.http import HttpClient\nfrom webdriver_manager.core.logger import log\n\nclass CustomHttpClient(HttpClient):\n\n    def get(self, url, params=None, **kwargs) -\u003e Response:\n        \"\"\"\n        Add you own logic here like session or proxy etc.\n        \"\"\"\n        log(\"The call will be done with custom HTTP client\")\n        return requests.get(url, params, **kwargs)\n\n\ndef test_can_get_chrome_driver_with_custom_http_client():\n    http_client = CustomHttpClient()\n    download_manager = WDMDownloadManager(http_client)\n    path = ChromeDriverManager(download_manager=download_manager).install()\n    assert os.path.exists(path)\n```\n\n---\n\nThis will make your test automation more elegant and robust!\n\nCheers\n","funding_links":["https://patreon.com/automation_remarks","https://www.patreon.com/automation_remarks"],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSergeyPirogov%2Fwebdriver_manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSergeyPirogov%2Fwebdriver_manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSergeyPirogov%2Fwebdriver_manager/lists"}