Find knowledge base article(s) by searching for keywords in the title e.g. type linux in the search box below
Find knowledge base article(s) by browsing the subject categories of articles
Technology quick references, cheatsheets, user manuals etc.
Shop Online through ShopifyLite
Tutorials on various IT applications.
Search Title    (UL:0 |SS:f)

Scripting >> Selenium >> Python >> How to avoid the need to automatically install the latest driver using webdriver_manager module

 

## The following examples are for Selenium 4.x

## Check installed version with

pip show selenium

## If not yet version 4.x, upgrade by

pip install selenium --upgrade



## Example for Chrome : selenium-webdriver-manager-chrome.py
import time
from selenium import webdriver
from selenium.webdriver.chrome.service import Service as ChromeService
from webdriver_manager.chrome import ChromeDriverManager

browser = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install()))
browser.get("https://www.google.com")
time.sleep(10)
browser.close()
browser.quit()


## Example for Firefox :
selenium-webdriver-manager-firefox.py
import time
from selenium import webdriver
from selenium.webdriver.firefox.service import Service as FirefoxService
from webdriver_manager.firefox import GeckoDriverManager

browser = webdriver.Firefox(service=FirefoxService(GeckoDriverManager().install()))
browser.get("https://www.google.com")
time.sleep(10)
browser.close()
browser.quit()

webdriver_manager


[ © 2008-2021 myfaqbase.com - A property of WPDC Consulting ]