Hi, I'm using selenium to take a screenshot. It was working last night but today I'm getting an error...help?
My code:
display = Display(visible=0, size=(800, 600))
display.start()
browser = webdriver.Firefox()
browser.get('http://www.work-points.com/report_chart')
browser.save_screenshot('/home/kyspy/esa-cm5/static/img/report.jpg')
browser.quit()
display.stop()
The error:
2014-03-06 16:51:22,657 :Exception on /report_as_pdf/3 [GET]
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1687, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1360, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1358, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1344, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/local/lib/python2.7/dist-packages/flask_login.py", line 515, in decorated_view
return fn(*args, **kwargs)
File "/home/kyspy/esa-cm5/views.py", line 366, in report_as_pdf
browser = webdriver.Firefox()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 61, in __init__
self.binary, timeout),
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/extension_connection.py", line 47, in __init__
self.binary.launch_browser(self.profile)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 51, in launch_browser
self._wait_until_connectable()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 90, in _wait_until_connectable
self._get_firefox_output())
WebDriverException: Message: "The browser appears to have exited before we could connect. The output was: \n(process:7397): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed\nError: cannot open display: :1358\n"