Python 报错 SyntaxError: invalid syntax 解决方法


脚本没有报错,但是有底色标记部分语句,运行后报错信息如下:

C:\Users\liushuang\AppData\Local\Programs\Python\Python36-32\python.exe C:/Users/liushuang/PycharmProjects/11/人员管理/人员清单.py
Traceback (most recent call last):
File "C:/Users/liushuang/PycharmProjects/11/人员管理/人员清单.py", line 2, in <module>
from selenium import webdriver
File "C:\Users\liushuang\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\__init__.py", line 18, in <module>
from .firefox.webdriver import WebDriver as Firefox # noqa
File "C:\Users\liushuang\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 29, in <module>
from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver
File "C:\Users\liushuang\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 378
def //*[@id="ItemForm"]/div[2]/div[4]/div[1]/div[2]/inputfind_element_by_xpath(self, xpath):
^
SyntaxError: invalid syntax

解决方案:

卸载selenium:pip uninstall selenium

重新安装:pip install selenium


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM