|
我的问题也是一样,浏览器能打开,但是打开之后就没反应了
selenium-2.33.0
firefox 21.0
-----------------------------
# 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()
下面是我发现的一些错误日志
------------------------------------------------------------------------------------------
Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>
Traceback (most recent call last):
File "C:\Documents and Settings\xuzheng\桌面\mail.py", line 5, in <module>
driver = 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'
>>> ================================ RESTART ================================ |
|