0

First of all, I read about this, but I'm not using python 2.7 and geckodriver 0.19.1.

So, I tried to get some data from the website every hour.

I installed selenium 3.141.0 on my python 3.7.3 and

geckodriver 0.24.0 on my Arch Linux for Odroid XU4.

But when I execute the code below,

from selenium import webdriver
browser = webdriver.Firefox()

I get error message like this.

Traceback (most recent call last):
  File "source/originAd.py", line 3, in <module>
    browser = webdriver.Firefox()
  File "/usr/lib/python3.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 174, in __init__
    keep_alive=True)
  File "/usr/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "/usr/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/usr/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/usr/lib/python3.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities

I know selenium tries to find driver in /usr/bin/ and I checked the driver exist. So, this isn't about

finding driver. I tried to build geckodriver by myself but I can't find how to use mach. so it'll be nice

if anyone can tell me why I got this error and how can I fix it. thanks.

+++++

I also installed firefox with

pacman -S firefox
SaGwa
  • 462
  • 3
  • 5

1 Answers1

0

as a suggestion I would try to tell webdriver where to find the Firefox binary:

from selenium import webdriver
driver = webdriver.Firefox(firefox_binary="PATH_TO_FIREFOX_BINARY")

someone had reported a similar problem here

Ammar
  • 1,305
  • 2
  • 11
  • 16
  • I edited my code like this, from selenium import webdriver browser = webdriver.Firefox(firefox_binary="/usr/bin/firefox") but it says same error message. – SaGwa May 16 '19 at 22:17
  • i dont have arch, so my resources are limited, I tried it in docker though, and when I installed firefox it landed in `/usr/sbin/firefox` (notice the **s**) – Ammar May 16 '19 at 22:42
  • well, there's a firefox in "/usr/bin" too. I tried both firefox but sadly it says same error. thanks anyway. – SaGwa May 16 '19 at 22:53