python 爬虫 selenium 与 chromedriver
selenium 安装
pip install selenium
chromedriver 下载
https://npm.taobao.org/mirrors/chromedriver?spm=a2c6h.14029880.0.0.735975d7UtIpWk
代码 模拟浏览器操作&自动化测试
#encodeing utf-8
import requests
from selenium import webdriver
import time
driver_path=r"E:\\tool\\python\\chromedriver\\chromedriver.exe"
driver=webdriver.Chrome(executable_path=driver_path)
driver.get("https://www.baidu.com/")
time.sleep(5)
driver.close()
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步