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:
- TypeError: 'module' object is not callable error with driver=webdriver("C:\Python34\Lib\site-packages\selenium\webdriver\chromedriver.exe")
- How to resolve Selenium with Python: TypeError: 'module' object is not callable
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")