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
from selenium import webdriver
File "C:\Users\liushuang\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\__init__.py", line 18, in
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
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

转载于:https://www.cnblogs.com/shimo/p/9951275.html

你可能感兴趣的:(Python 报错 SyntaxError: invalid syntax 解决方法)