1
python -m pip install selenium
然后使用selenium中的webdriver来进行模拟网页点击:
1
2
3
4
5
6
7
8
9
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support.ui import WebDriverWait
sel=webdriver.Chrome() #也可换成Ie(),Firefox()等
element=sel.find_element() #在网页源码中查找元素
element.click() #模拟对元素进行点击
如果你是Chrome用户,需要手动下载一个chromedriver.exe,这里附上,把它放入系统Path路径任意一个文件夹中即可