Browser raise NoneType
Code: ''' from splinter import Browser
browser = Browser('chrome') '''
result: TypeError: 'NoneType' object is not callable
I can't find the reason
@MacroHongZ do you have a stack trace?
I'm getting the same result. Installed splinter on python 3.10 and ran the same as above and got the following:
>>> browser = Browser()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/envs/splinter/lib/python3.10/site-packages/splinter/browser.py", line 121, in Browser
return get_driver(driver, retry_count=retry_count, *args, **kwargs)
File "/envs/splinter/lib/python3.10/site-packages/splinter/browser.py", line 92, in get_driver
return driver(*args, **kwargs)
TypeError: 'NoneType' object is not callable
@MacroHongZ @adamcheasley You're seeing this message because you didn't install the driver for the browser you're trying to use.
#1093 Catches this situation and returns an error message so this is more obvious.
You can either install selenium separately or when you install splinter with pip install splinter[selenium4]
@jsfehler what do you think about to create an issue to improve this error message to users know that is necessary to install selenium?
@jsfehler thanks for confirming! Yes, +1 for a better error message there.
@andrewsmedina In the future we can check the driver name and return a more specific message. I've also updated the docs to make the installation process more obvious to new users.
@jsfehler Thanks for your comment, the error is indeed due to Selenium not installed, but the error message is too ambiguous to find the cause. I would suggest that the doc could be updated to : “ pip install selenium pip install splinter“