Home > Mobile >  How to address 'module' object not callable in python selenium
How to address 'module' object not callable in python selenium

Time:11-13

I have recently got a problem while working with selenium for making a Twitter bot. The code is:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

option = Options()
option.add_argument("start-maximized")
driver = webdriver.chrome(options=option)

driver.get("http://twitter.com/login")

The Error I have been getting is:

'module' object is not callable

How can I fix this ??

CodePudding user response:

Instead of chrome() you need to call Chome()

Your effective line of code will be:

driver = webdriver.Chrome(options=option)

References

You can find a couple of relevant detailed discussions in:

CodePudding user response:

You are using chrome, instead it should have been Chrome.

Not that it is case-sensitive.

Also, I see you are missing --

at this line

option.add_argument("start-maximized")

So, your code should be like this :

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

option = Options()
option.add_argument("--start-maximized")
driver = webdriver.Chrome(options=option)

driver.get("http://twitter.com/login")
  • Related