0

I have this code:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
print("Sample test initiated")
#driver selection
driver = webdriver.chrome(r"/Users/ananyarai/Downloads/chromedriver.exe")

It causes the following error:

"/Users/ananyarai/PycharmProjects/pythonProject1/venv/bin/python "/Users/ananyarai/PycharmProjects/pythonProject1/Demo /Sample 2.py"
Traceback (most recent call last):
  File "/Users/ananyarai/PycharmProjects/pythonProject1/Demo /Sample 2.py", line 7, in <module>
    driver = webdriver.chrome(r"/Users/ananyarai/Downloads/chromedriver.exe")
TypeError: 'module' object is not callable"
Sample test initiated
2
  • Welcome to Stack Overflow. Please read How to Ask. It is good to show us your code and your error message, but you also need to a) try to read and understand the error message; b) try to fix the problem yourself (see ericlippert.com/2014/03/05/how-to-debug-small-programs and meta.stackoverflow.com/questions/261592); c) explain why that failed; d) ask a question. Commented Dec 23, 2021 at 7:32
  • Also: When you run into problems trying to do even basic things with a third-party library, you should first think of reading the documentation. Usually it will have examples of common use. You can also try using a search engine: for example. Commented Dec 23, 2021 at 7:35

1 Answer 1

0

I think you misspelled this part here driver = webdriver.chrome(r"/Users/ananyarai/Downloads/chromedriver.exe")

Using something like driver = webdriver.Chrome('C:\\path to \\chromedriver.exe')gets the desired result.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.