簡體   English   中英

Python Splinter瀏覽器= Browser()無法正常工作

[英]Python Splinter browser = Browser() not working

我正在嘗試使用碎片測試我的webapp。 當我嘗試執行以下命令

>>> from splinter import Browser
>>> browser = Browser()

我得到這個錯誤。 我一直在環顧四周,但不確定如何解決。 有人可以告訴我如何克服這個嗎?

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/danny/anaconda/lib/python2.7/site-packages/splinter/browser.py", line 63, in Browser
    return driver(*args, **kwargs)
  File "/Users/danny/anaconda/lib/python2.7/site-packages/splinter/driver/webdriver/firefox.py", line 39, in __init__
    self.driver = Firefox(firefox_profile)
  File "/Users/danny/anaconda/lib/python2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 103, in __init__
    self.binary, timeout)
  File "/Users/danny/anaconda/lib/python2.7/site-packages/selenium/webdriver/firefox/extension_connection.py", line 51, in __init__
    self.binary.launch_browser(self.profile, timeout=timeout)
  File "/Users/danny/anaconda/lib/python2.7/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 67, in launch_browser
    self._start_from_profile_path(self.profile.path)
  File "/Users/danny/anaconda/lib/python2.7/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 90, in _start_from_profile_path
    env=self._firefox_env)
  File "/Users/danny/anaconda/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/Users/danny/anaconda/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception

這是從firefox_binary.py拋出的代碼: https : //github.com/SeleniumHQ/selenium/blob/master/py/selenium/webdriver/firefox/firefox_binary.py#L79-L90

您是否已安裝Firefox並正常工作? 我還將嘗試更新Firefox,以確保它是最新版本。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM