简体   繁体   English

Python Splinter浏览器= Browser()无法正常工作

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

I am trying to use splinter to test my webapp. 我正在尝试使用碎片测试我的webapp。 When I try to execute the following 当我尝试执行以下命令

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

I get this error. 我得到这个错误。 I have been looking around but I'm not sure how to fix. 我一直在环顾四周,但不确定如何解决。 Could someone please tell me how to get past this? 有人可以告诉我如何克服这个吗?

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

Here's the code from firefox_binary.py that is throwing: https://github.com/SeleniumHQ/selenium/blob/master/py/selenium/webdriver/firefox/firefox_binary.py#L79-L90 这是从firefox_binary.py抛出的代码: https : //github.com/SeleniumHQ/selenium/blob/master/py/selenium/webdriver/firefox/firefox_binary.py#L79-L90

Do you have Firefox installed and working properly? 您是否已安装Firefox并正常工作? I would also try updating Firefox to make sure it's on the latest version. 我还将尝试更新Firefox,以确保它是最新版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM