import selenium
from selenium import webdriver
def init_driver():
driver = webdriver.chrome('C:/Users/Who/chromedriver.exe')
driver.wait = WebDriverWait(driver, 5)
return driver
Traceback (most recent call last):
File "C:\Users\Who\Documents\atom\c", line 154, in <module>
driver= init_driver()
File "C:\Users\Who\Documents\atom\c", line 15, in init_driver
driver = webdriver.chrome('C:/Users/Who/chromedriver.exe')
TypeError: 'module' object is not callable
[Finished in 0.902s]
Why is it like this when I keep getting the above error or the error that the webdriver is not defined while crawling through selenium?
selenium-webdrive
The command to specify the web driver is not at the top of the module.
import selenium
selenium.webdriver.chrome.webdriver.WebDriver(executable_path='chromedriver path')
https://selenium-python.readthedocs.io/api.html#module-selenium.webdriver.chrome.webdriver
537 Uncaught (inpromise) Error on Electron: An object could not be cloned
548 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
547 Who developed the "avformat-59.dll" that comes with FFmpeg?
546 Understanding How to Configure Google API Key
709 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2024 OneMinuteCode. All rights reserved.