-1

I've been trying to start using selenium on my laptop, but i just keep getting into errors, after about 1h I'm done trying to fix it by myself.

Selenium version: 3.141.0
chromedriver versoin: 860224
Chrome version: 90.0.4430.11
OS: Arch Linux x86_64

I have this following bit of code(which is copied from the post here:

import selenium
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
options = Options()
options.binary_location = r'/opt/google/chrome-unstable/google-chrome-unstable'
driver = webdriver.Chrome(options= options, executable_path= '/home/andrei399/Downloads/chromedriver_linux64/chromedriver')
driver.get('http://google.com/')

Can anyone please help me? I've been over a lot of stuff, before i restarted my laptop it said it didn't find any binary file, although the path led straight to the x program, I've tried with chrome (not chrome-unstable), although now that doesn't seem to be the problem anymore.

1 Answers1

2

You are using webdriver.Chrome function but you have imported firefox options

Change your code to the following

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = Options()
options.binary_location = r'/opt/google/chrome-unstable/google-chrome-unstable'
driver = webdriver.Chrome(options= options, executable_path= '/home/andrei399/Downloads/chromedriver_linux64/chromedriver')
driver.get('http://google.com/')
  • Oh my god, you're right, i wanted to do it with firefox at first but gecko was not working, thought i'd switch to chrome but totally forgot about changing that.Thank you so much. – Andrei Cristian TUDOR Mar 06 '21 at 17:41