1

Amazon EC2 でセレンを実行しようとしています。xvfb ラッパーとして pyvirtualdisplay を使用しています。Pythonで次のコマンドを実行しました。

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

今まではすべてうまくいっています。
しかし、私がするとき:

driver = webdriver.Firefox()

次のエラーが表示されます。

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.
4

1 に答える 1

1

インターネットで何時間もかけて解決策を探し、可能な限りのことを試した結果、うまくいったことの 1 つがこれです。
https://superuser.com/questions/870702/aws-ec2-linux-headless-firefox-issue-xvfb-undefined-symbol-pixman-glyph-cache

答えが言うように:
それはwring pixmanをロードしようとしています。/usr/local/lib/libpixman-1.so.0 を削除して再試行すると、Xvfb はこのシンボルを持つディストリビューション pixman ライブラリを使用するようになります。

于 2015-03-09T18:24:29.783 に答える