pip install selenium # Windows
pip3 install selenium # Mac
下载地址:https://chromedriver.chromium.org/downloads
注意浏览器版本
将下载好的chromedriver_win32.zip解压得到一个chromedriver.exe文件,将其复制到你的Python程序执行路径。
chrome.exe --remote-debugging-port=9222
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
配置 = Options()
配置.debugger_address = 'localhost:9222'
驱动位置 = "./Data/chromedriver.exe" #我是把chromedriver驱动放在项目根目录下
浏览器 = webdriver.Chrome(驱动位置, chrome_options=配置)
print(浏览器.title)
页面更新:2024-06-02
本站资料均由网友自行发布提供,仅用于学习交流。如有版权问题,请与我联系,QQ:4156828
© CopyRight 2020-2024 All Rights Reserved. Powered By 71396.com 闽ICP备11008920号-4
闽公网安备35020302034903号