0
import selenium
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys

mobile_emulation = {
    "deviceName": "iPhone X" 
}

chrome_options = webdriver.ChromeOptions()

chrome_options.add_experimental_option("mobileEmulation", mobile_emulation)

chrome_path = "/home/pi/Desktop/chromedriver"

driver = selenium.webdriver.Chrome(executable_path=chrome_path, options=chrome_options)

I am trying to make a python 3 script to work on my Raspberry Pi 4, I made the script in Windows 10. When running this script on my Raspberry Pi I get the following error:

OSError: [Errno 8] Exec format error: '/home/pi/Desktop/chromedriver'

Does anyone know what the problem could be? I am fairly new to Linux so any help would be appreciated.

ShivaGaire
  • 2,283
  • 1
  • 20
  • 31
  • The problem is that the program you are running is not the same architecture as the raspberry pi. More info -https://stackoverflow.com/questions/38732822/compile-chromedriver-on-arm – Yatharth Ranjan Jun 05 '21 at 10:57

1 Answers1

0

The official repository already has the chromedriver package called chromium-chromedriver. Just install it by using apt command.
You may use dpkg-query -L chromium-chromedriver command to find the location of chromedriver executable.
BTW, It's a duplicate question, How to run selenium+chrome on Raspberry PI 4?.

Jayce Cao
  • 1
  • 1
  • 4