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()