Home>

When I execute the code below, I get addicted to the error that the module cannot be called.
I've been searching all day, but the rattling has disappeared.
Please tell me what is wrong and how to deal with it.

from selenium import webdriver
from time import sleep
browser = webdriver.chrome ('chromedriver.exe') # I get an error here
raceback (most recent call last):
  File "c: /work/09-Script/MyPython/web-test.py", line 5, in<module>
    browser = webdriver.chrome ('chromedriver.exe')
TypeError:'module' object is not callable

The python version and pip list are as follows.

python -V
Python 3.8.6
pip list
Package Version
----------------- -------
astroid 2.4.2
colorama 0.4.4
isort 5.6.4
lazy-object-proxy 1.4.3
mccabe 0.6.1
pip 20.2.4
pylint 2.6.0
selenium 3.141.0
six 1.15.0
toml 0.10.2
urllib3 1.26.2
wrapt 1.12.1
  • Answer # 1

    Capitalize C.

    -browser = webdriver.chrome ('chromedriver.exe')
    + browser = webdriver.Chrome ('chromedriver.exe')

  • Answer # 2

    browser = webdriver.chrome ('chromedriver.exe')

    browser = webdriver.Chrome ('chromedriver.exe')is not it.
    Uppercase and lowercase letters are different, so let's distinguish them.

    'chromedriver.exe'Is not written with the full pass, but is it placed where the pass passes?