0

Hello I have this code which work on my laptop with Linux :

from selenium import webdriver
import time

driver = webdriver.Chrome('/home/user/chromedriver') 

driver.get('www.google.fr')
time.sleep(10)
driver.save_screenshot("screenshot.png")

driver.close()

And when I try to execute this python code on my raspberry it does not work !

It looks like there is no available version of chromedriver which work on raspberry...

  • You should include the actual error message and re-frame this as a question. A quick google search seems to indicate that this is possible. https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=129320 – Boo Radley Jan 26 '18 at 18:36

1 Answers1

0

It looks like you're probably not using the Google Chrome browser, but instead using Chromium, which Google Chrome is built off of. Given this additional information, it was trivial to find a Stack Overflow answer to get Selenium working with Chromium. (link)

Since Chromium isn't officially supported by Selenium, you'll need to instruct Selenium to use a custom browser like so:

DefaultSelenium selenium = new DefaultSelenium("localhost", 4444, "/usr/bin/chromium-browser/chromium-browser" , "www.example.com");
selenium.start();
andrewgu
  • 1,510
  • 16
  • 22