coding=utf-8fromseleniumimportwebdriverbrowser=webdriver.Chrome()browser=get("网页地址")browser.find_element_by_id("kw").send_keys("selenium")browser.find_element_by_id("...
coding = utf-8
from selenium import webdriver
browser=webdriver.Chrome()
browser=get("网页地址")
browser.find_element_by_id("kw").send_keys("selenium")
browser.find_element_by_id("su").click()
browser.quit()
上面我测得代码
我装了python。pip setuptool Selenium 可是运行报错
Traceback (most recent call last):
File "E:/pythonfile/a", line 3, in
browser=webdriver.Chrome()
File "C:\Python27\lib\site-packages\selenium-2.41.0-py2.7.egg\selenium\webdriver\chrome\webdriver.py", line 65, in __init__
keep_alive=True)
File "C:\Python27\lib\site-packages\selenium-2.41.0-py2.7