Splinter: DriverNotFoundError for zope.testbrowser

I use Python Splinter to automate a website and clear data from it. When I use the default browser mode, which remains empty in the browser (), it opens firefox and completes the written task, but when I use the mute browser "zope.testbrowser", I get the following error. What do i need to do here?

Traceback (most recent call last): File "pysplinter.py", line 4, in <module> browser = Browser('zope.testbrowser') File "/usr/local/lib/python2.7/dist-packages/splinter/browser.py", line 62, in Browser raise DriverNotFoundError("No driver for %s" % driver_name) splinter.exceptions.DriverNotFoundError: No driver for zope.testbrowser 
+4
source share
1 answer

I do not know how relevant this is, but I’ll publish it for others anyway.

I had the same problem and my problem was that the mechanize module was not installed.

Fix

 pip install mechanize 

However, after that I came across another issue .

Explanation

What is a line of code that fails in browser.py from splinter , but because of except: pass , it is silently ignored. If done manually, you can see the root of the problem:

 >>> from splinter.driver.zopetestbrowser import ZopeTestBrowser Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/rustam/.virtualenvs/python2/lib/python2.7/site-packages/splinter/driver/zopetestbrowser.py", line 19, in <module> import mechanize ImportError: No module named mechanize 
+3
source

All Articles