TA的每日心情 | 奋斗 2017-5-18 14:37 |
---|
签到天数: 1 天 连续签到: 1 天 [LV.1]测试小兵
|
程序如下:
from selenium import webdriver # 导入webdriver包
driver = webdriver.Firefox() # 初始化一个火狐浏览器实例:driver
driver.maximize_window() # 最大化浏览器
driver.get("https://www.baidu.com") # 通过get()方法,打开一个url站点
driver.quit()
运行后提示:
Traceback (most recent call last):
File "D:\TEST\Shell\py\open_firefox.py", line 1, in <module>
from selenium import webdriver # 导入webdriver包
File "C:\python\lib\site-packages\selenium\webdriver\__init__.py", line 18, in <module>
from .firefox.webdriver import WebDriver as Firefox # noqa
File "C:\python\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 19, in <module>
import http.client as http_client
File "D:\TEST\Shell\py\http.py", line 31
def_init_(self,sFile,dtitleindex=3,dcasebegin=4,dargbegin=3,dargcount=8):
^
SyntaxError: invalid syntax
请问大神这是什么原因导致的?
|
|