Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 99018

Seleium and Geckodriver not working python [duplicate]

$
0
0

I am trying to write a program using selenium in python that will open a firefox window and go to twitter. I have placed the geckdriver.exe in my python 3.6 folder and installed firefox. I have also ran 'pip install selnium' and installed selenium.

This is the code i have written:

from selenium import webdriver

browser = webdriver.Firefox(executable_path="C:\\Users\\Harry\\AppData\\Local\\Programs\\Python\\Python36-32\\geckodriver.exe")
browser.get("https://www.twitter.com/")`

When run the output is:

PS C:\Users\Harry\Desktop\Coding\Python\Bots\TwitterBot> python app.py Traceback (most recent call last): File "app.py", line 5, in browser = webdriver.Firefox() File "C:\Users\Harry\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 174, in init keep_alive=True) File "C:\Users\Harry\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in init self.start_session(capabilities, browser_profile) File "C:\Users\Harry\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "C:\Users\Harry\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute self.error_handler.check_response(response) File "C:\Users\Harry\AppData\Local\Programs\Python\Python36-32\lib\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

Why is this and what can i do to fix it? I am using python 3.6 and Visual Studio Code to code my program. Firefox version is latest one out at time of writing.


Viewing all articles
Browse latest Browse all 99018

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>