“TypeError: 'module' object is not callable” with webdriver.chrome

折月煮酒 提交于 2020-05-15 02:39:31

问题


from selenium import webdriver 

driver = webdriver.chrome("F:\\chromedriver.exe")

driver.get("https://www.nvidia.in/graphics-cards/geforce/pascal/buy/")

回答1:


In python, letter 'c' will be in upper case in the function chrome().

INCORRECT

import webdriver

driver = webdriver.chrome("F:\\chromedriver.exe")

PROPER:

from selenium import webdriver
import selenium

driver = webdriver.Chrome("F:\\Chromedriver.exe")



回答2:


from selenium import webdriver
import selenium 
driver = webdriver.Chrome()
driver.get("http://www.python.org")

C should be capital in webdriver.Chrome()

Also, the path for driver is not required. The driver is already installed on the computer.




回答3:


Yor are miss spell the class name. It is not chrome(), Chrome().

webdriver.chrome("F:\\chromedriver.exe")

to

webdriver.Chrome("F:\\chromedriver.exe")

or

webdriver.Chrome()




回答4:


from selenium import webdriver
import selenium

driver = webdriver.Chrome(r"C:\Users\007\Desktop\chromedriver_win32\chromedriver.exe")

driver.get("http://www.python.org")


来源:https://stackoverflow.com/questions/51188180/typeerror-module-object-is-not-callable-with-webdriver-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!