我已经做了一段时间了,希望能得到帮助。我在rn上的代码是:
from selenium import webdriver
PATH = "C:\Program Files (x86)\Chromedriver.exe"
driver = webdriver.Chrome(PATH)
driver.get("https://www.youtube.com/")
错误代码:
C:Usersnoahr.virtualenvspythonProject-ME1SVWk8Scriptspython.exe C:/Users/noahr/PycharmProjects/pythonProject/main.py
Traceback (most recent call last):
File "C:UsersnoahrPycharmProjectspythonProjectmain.py", line 3, in <module>
driver = webdriver.chrome()
TypeError: 'module' object is not callable
Process finished with exit code 1
查看您的代码似乎没有问题,当我能够在我的机器上执行您的代码时(除了更改chromedriver路径)。
然而,当我看你的日志,它提到driver = webdriver.chrome()。如果这正是你在代码中所拥有的,那么它应该是driver = webdriver.Chrome(PATH) -请注意大写">