selenium 自动匹配下载驱动之 webdriver_manaer配置

使用谷歌浏览器需要使用梯子,edge则不用梯子就可以成功。

pip10 install selenium webdriver-manager

https://cloud.tencent.com.cn/developer/article/2315585
https://gitcode.com/gh_mirrors/we/webdriver_manager/overview?utm_source=outstanding_ugc_gitcode&index=top&type=card&webUrl&isLogin=1

from selenium import webdriver
from selenium.webdriver.chrome.service import Service as ChromeService
from webdriver_manager.chrome import ChromeDriverManager

driver = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install()))
driver.get("https://www.bilibili.com/")

  驱动保存在C:\Users\Administrator\.wdm\drivers\chromedriver\win64\131.0.6778.85

posted @ 2024-11-22 11:06  强仔必胜  阅读(5)  评论(0编辑  收藏  举报