|
# coding = utf-8
from selenium import webdriver
browser = webdriver.Firefox()
browser.get("http://www.baidu.com")
browser.find_element_by_id("kw").send_keys("selenium")
browser.find_element_by_id("su").click()
browser.quit()
执行的时候出错了谁知道原因啊??
-------------------------------------------------------------
>>> ================================ RESTART ================================
>>>
Traceback (most recent call last):
File "C:\Documents and Settings\xuzheng\桌面\baidu.py", line 4, in <module>
browser = webdriver.Firefox()
File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 62, in __init__
desired_capabilities=capabilities)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 72, in __init__
self.start_session(desired_capabilities, browser_profile)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 116, in start_session
self.session_id = response['sessionId']
KeyError: 'sessionId'
>>> |
|