腳本沒有報錯,但是有底色標記部分語句,運行后報錯信息如下:
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