1

I am trying to run selenium on Amazon EC2. I am using pyvirtualdisplay as xvfb wrapper. I ran the following commands in python.

from pyvirtualdisplay import Display
from selenium import webdriver
display = Display(visible=0, size=(1024, 768))
display.start()

Everything goes fine till now.
But when I do:

driver = webdriver.Firefox()

I get this error:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/site-   packages/selenium/webdriver/firefox/webdriver.py", line 59, in __init__
self.binary, timeout),
File "/usr/lib/python2.6/site-packages/selenium/webdriver/firefox/extension_connection.py", line 47, in  __init__
self.binary.launch_browser(self.profile)
File "/usr/lib/python2.6/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 66, in launch_browser
self._wait_until_connectable()
File "/usr/lib/python2.6/site- packages/selenium/webdriver/firefox/firefox_binary.py", line 100, in _wait_until_connectable
raise WebDriverException("The browser appears to have exited "
selenium.common.exceptions.WebDriverException: Message: The browser   appears to have exited before we could connect. If you specified a    log_file in the FirefoxBinary constructor, check it for details.
nishantsingh
  • 4,537
  • 5
  • 25
  • 51

1 Answers1

1

After spending many hours on the internet searching for solutions and trying every possible thing out, one thing which worked for me is this.
https://superuser.com/questions/870702/aws-ec2-linux-headless-firefox-issue-xvfb-undefined-symbol-pixman-glyph-cache

As the answer says:
It is trying to load wring pixman so. Delete /usr/local/lib/libpixman-1.so.0 and try again, it will make Xvfb use distribution pixman library which has this symbol.

Community
  • 1
  • 1
nishantsingh
  • 4,537
  • 5
  • 25
  • 51