1

ビーグルボーン マシンに Splinter Python ライブラリをインストールしました。splinter Web サイトで提供されている例を使用すると、エラーが発生します。これを機能させるには、Webドライバーをインストールする必要があると思います。

beeaglebone arm7 プラットフォームのコマンドラインに Web ドライバーをインストールした人はいますか?

変更されていないコード

from splinter import Browser

 with Browser() as browser:
     # Visit URL
     url = "http://www.google.com"
     browser.visit(url)
     browser.fill('q', 'splinter - python acceptance testing for web applications')
     # Find and click the 'search' button
     button = browser.find_by_name('btnG')
     # Interact with elements
     button.click()
     if browser.is_text_present('splinter.cobrateam.info'):
         print "Yes, the official website was found!"
     else:
         print "No, it wasn't found... We need to improve our SEO techniques" 

そして、エラーは

Traceback (most recent call last):
  File "http1.py", line 3, in <module>
    with Browser() as browser:
  File "build/bdist.linux-armv7l/egg/splinter/browser.py", line 44, in Browser
  File "build/bdist.linux-armv7l/egg/splinter/driver/webdriver/firefox.py", line 33, in __init__
  File "/usr/lib/python2.7/site-packages/selenium-2.33.0-py2.7.egg/selenium/webdriver/firefox/webdriver.py", line 61, in __init__
    self.binary, timeout),
  File "/usr/lib/python2.7/site-packages/selenium-2.33.0-py2.7.egg/selenium/webdriver/firefox/extension_connection.py", line 47, in __init__
    self.binary.launch_browser(self.profile)
  File "/usr/lib/python2.7/site-packages/selenium-2.33.0-py2.7.egg/selenium/webdriver/firefox/firefox_binary.py", line 51, in launch_browser
    self._wait_until_connectable()
  File "/usr/lib/python2.7/site-packages/selenium-2.33.0-py2.7.egg/selenium/webdriver/firefox/firefox_binary.py", line 90, in _wait_until_connectable
    self._get_firefox_output())
selenium.common.exceptions.WebDriverException: Message: "The browser appears to have exited before we could connect. The output was: ERROR: ld.so: object 'x_ignore_nofocus.so' from LD_PRELOAD cannot be preloaded: ignored.\nError: no display specified\n"
4

2 に答える 2

2

少し遅すぎるかもしれませんが、念のため:

Firefox がインストールされていなかったため、同じ問題が発生しました。Splinter は selenium に基づいており、デフォルトのブラウザーとして Mozilla Firefox を使用するため、次のいずれかを行います。

  • Firefox をインストールする

また

それが役に立てば幸い!

于 2014-12-02T04:34:42.857 に答える
0

よくわかりませんが(実際のデスクトップでスプリンターを実行しただけです)、問題は指定されたディスプレイがないことだけだと思います。デスクトップでデフォルト コードを実行すると、Web ブラウザ ウィンドウが開きます。ここでも同じことをしようとしているに違いありません。質問してから問題は解決しましたか?

于 2014-03-31T18:52:31.873 に答える