求 大大大大佬 解答一下小问题
Tofloor
poster avatar
dust-in-the-wind
deepin
2019-10-15 00:16
Author

大佬帮忙想一想决绝方法 有偿也行 给点提示也好

我用deepin+anaconda的selenium+pycharm +geckodriver调用firefox浏览器失败
但是ubuntu+anaconda的selenium+pycharm+geckodriver调用却可以

他们的差别就是一个是安装的firefox(deepin) 一个是自带的(ubuntu)
我在deepin下试过不下30几次了 不管网上有多少种安装deepin的方式都无一成功

运行代码:
from selenium import webdriver

driver=webdriver.Firefox()
url='http://www.baidu.com'
driver.get(url)


报错如下
Traceback (most recent call last):
  File "./a.py", line 5, in
    driver = webdriver.Firefox()
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 152, in __init__
    keep_alive=True)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 98, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 188, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 256, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Unable to find a matching set of capabilities
Reply Favorite View the author
All Replies
avatar
chenhacker
deepin
2019-10-15 05:18
#1
估计环境变量有点问题,找个firefox.deb装上试试
Reply View the author
avatar
dust-in-the-wind
deepin
2019-10-19 01:27
#2
https://bbs.deepin.org/post/183785
估计环境变量有点问题,找个firefox.deb装上试试

好的 我去试试看
Reply View the author
avatar
dust-in-the-wind
deepin
2019-11-18 10:09
#3
很是奇怪 我用了台式电脑的linux就可以了 但是笔记本的linux就是不行 我两个同时装的 文件也是我网盘上的 这deepin这么肥事?????????
Reply View the author