"TypeError: 'module' object is not callable" with webdriver.chrome
Asked Answered
M

7

6
from selenium import webdriver 

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

driver.get("https://www.nvidia.in/graphics-cards/geforce/pascal/buy/")
Meatiness answered 5/7, 2018 at 9:47 Comment(1)
What are you even asking. I don't see a single ?Restrained
L
11

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")
Lombardo answered 6/10, 2018 at 5:2 Comment(2)
Please add more explanation to your answerPallmall
@Mastisa this error usually occurs because of c of "chrome" is not capital.Dunnage
V
4
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.

Virology answered 26/2, 2020 at 1:0 Comment(0)
P
1

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()

Pearlstein answered 8/4, 2020 at 7:9 Comment(0)
L
1
from selenium import webdriver
import selenium

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

driver.get("http://www.python.org")
Lakeshialakey answered 2/5, 2020 at 7:8 Comment(1)
Please don't post only code as answer, but also provide an explanation what your code does and how it solves the problem of the question. Answers with an explanation are usually more helpful and of better quality, and are more likely to attract upvotes.Pitcher
W
1

Can you do this to see if it's installed?

import selenium

print selenium.__version__

As for the

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

You can just use: driver = webdriver.Chrome();

in Chrome the c has to be a capital letter.

Walkup answered 23/11, 2020 at 18:34 Comment(0)
D
0

first install webdriver manager and write the below code pip install webdriver-manager

from webdriver_manager.chrome import ChromeDriverManager
from selenium import webdriver

driver = webdriver.Chrome(ChromeDriverManager().install())
driver.get("desired url")
Detriment answered 2/10, 2020 at 5:39 Comment(0)
M
0

You can use this -

from selenium 
import webdriver

from selenium.webdriver.chrome.service 
import Service

service_obj=Service() 
driver= webdriver.Chrome(service=service_obj) driver.get("https://www.linkedin.com/feed/?trk=")
Merchant answered 10/1 at 8:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.