Turns out that try, except, finally logic was hiding the error. Removing that showed:
Code: Select all
Script Error Exception Traceback (most recent call shown last):
spa_on.py, line 69, at top level
spa_on.py, line 34, in newBrowser
File "/Library/Python/2.7/site-packages/selenium/webdriver/phantomjs/webdriver.py", line 56, in __init__
self.service.start()
File "/Library/Python/2.7/site-packages/selenium/webdriver/common/service.py", line 83, in start
os.path.basename(self.path), self.start_error_message)
WebDriverException: Message: 'phantomjs' executable needs to be in PATH.
So I just had to change the webdriver line like so:
Code: Select all
new_browser = webdriver.PhantomJS('/usr/local/bin/phantomjs')
And now it works.