webdriver-manager

 

2023-08-01

Webdriver 管理器,支持 Chrome FirFox


使用

1
# selenium 4 and chromium
2
from selenium import webdriver
3
from selenium.webdriver.chrome.service import Service as ChromiumService
4
from webdriver_manager.chrome import ChromeDriverManager
5
from webdriver_manager.core.utils import ChromeType
6
7
driver = webdriver.Chrome(service=ChromiumService(ChromeDriverManager(chrome_type=ChromeType.CHROMIUM).install()))