I am trying to open Chromium with Selenium using PyCharm. This is my code:
from selenium import webdriver
options = webdriver.ChromeOptions()
options.binary_location = '/usr/bin/chromium-browser'
chrome_driver_binary = '/opt/WebDriver/bin/chromedriver'
driver = webdriver.Chrome(chrome_driver_binary, chrome_options=options)
driver.get('http://google.com/')
And I get an error in line starting with 'driver = '
selenium.common.exceptions.WebDriverException: Message: unknown error: no chrome binary at /usr/bin/chromium-browser
Actually, in /usr/bin there is a thing called chromium-browser, an executable file.
I also tried this solution from Set chrome browser binary through chromedriver in Python, but no better:
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
cap = DesiredCapabilities.CHROME
cap = {'binary_location': '/usr/bin/chromium-browser'}
driver = webdriver.Chrome(desired_capabilities=cap, executable_path='/opt/WebDriver/bin/chromedriver')
driver.get('http://google.com/')
gives:
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary
Any help? Third hour googling over it ;)