TA的每日心情 | 奋斗 2017-5-22 16:25 |
---|
签到天数: 9 天 连续签到: 1 天 [LV.3]测试连长
|
代码:
# coding=utf-8
from selenium import webdriver
driver=webdriver.Firefox()
driver.get("http://www.baidu.com")
driver.find_element_by_id("kw").send_keys("Selenium2")
driver.find_element_by_id("su").click()
driver.quit()
错误提示是这样的:
Traceback (most recent call last):
File "C:\baidu.py", line 4, in <module>
driver=webdriver.Firefox()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 144, in __init__
self.service.start()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\site-packages\selenium\webdriver\common\service.py", line 96, in start
self.assert_process_still_running()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\site-packages\selenium\webdriver\common\service.py", line 109, in assert_process_still_running
% (self.path, return_code)
selenium.common.exceptions.WebDriverException: Message: Service geckodriver unexpectedly exited. Status code was: 2
真的搞不明白了,求大神帮忙,我是自学的,小白一个 |
|