Computer Hope

Software => Computer programming => Topic started by: Betsy298 on October 30, 2020, 11:51:10 PM

Title: AttributeError: module 'selenium.webdriver' has no attribute 'webdriver'
Post by: Betsy298 on October 30, 2020, 11:51:10 PM
I've installed selenium correctly as well as the chromium webdriver for selenium and I keep getting the following error

    Traceback (most recent call last):
  File "C:/Users/Turtle/PycharmProjects/SpotifyWebscraper/seleniumTest.py", line 3, in <module>
    driver = webdriver.chrome()
TypeError: 'module' object is not callable
here is my code:

from selenium import webdriver

driver = webdriver.chrome()
driver.get("htts://www.google.com")

print(driver.title)
print(driver.current_url)

driver.quit
I've checked in the folders correctly and the files seem to be in the right positions:

C:\Users\Turtle\AppData\Local\Programs\Python\Python38\Lib\site-packages\selenium-4.0.0a3-py3.8.egg\selenium\webdriver\chromium
contains webdriver.py (https://www.acesetm.us/)