0

Environment:

  1. embedded linux system on target board
  2. with chromium(not google chrome) installed
  3. I can access with /usr/bin/chromium www.google.com
  4. with python module selenium.webdriver installed

Issue Description:

  1. chromium version is "Chromium 71.0.3545.0 stable" and there is no google-chrome on my board. lrwxrwxrwx 1 root root 34 Nov 29 00:14 /usr/bin/chromium -> /usr/lib/chromium/chromium-wrapper

  2. I downloaded "ChromeDriver 2.45" ->"chromedriver_linux64.zip" which said "Supports Chrome v70-72", unzip and put "chromedriver" to /usr/bin

  3. Then I did as following steps and got such error

    Python 2.7.15 (default, Nov 26 2018, 01:36:34)
    [GCC 7.3.0] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from selenium.webdriver.chrome.options import Options
    >>> from selenium import webdriver
    >>> opts=Options()
    >>> opts.binary_location="/usr/bin/chromedriver"
    >>> driver=webdriver.Chrome(chrome_options=opts)
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/lib/python2.7/site-p 
    packages/selenium/webdriver/chrome/webdriver.py", line 73, in __init__
    self.service.start()
    File "/usr/lib/python2.7/site- 
    packages/selenium/webdriver/common/service.py", line 76, in start
    stdin=PIPE)
    File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
    File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
    OSError: [Errno 8] Exec format error
    
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352

1 Answers1

0

As you are using embedded linux system on target board and Chromium 71.0 instead of "ChromeDriver 2.45" ->"chromedriver_linux64.zip" you need to download chromedriver-v2.21-linux-armv7l from this link and use it within your program as follows:

from selenium.webdriver.chrome.options import Options
from selenium import webdriver
opts=Options()
opts.binary_location='/path/to/chrome' #Chromium 71.0 executable binary
driver = webdriver.Chrome(chrome_options=opts, executable_path='/path/to/chromedriver.exe')

You can find a couple of relevant discussions in:

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • I did as you said but it still doesn't work. It prompts "Message: 'chromedriver' executable needs to be in PATH", seems the chromedriver not match with my platform. – underdog Jan 28 '19 at 02:42
  • I got such reply from chromium.org: Comment 4 by johnchen@chromium.org, Today (9 hours ago) Project Member Labels: -Needs-Feedback Status: WontFix (was: Unconfirmed) We don't support chromedriver on arm CPU, and have never release a build of chromedriver that runs on arm. Since chromedriver is open source, anyone can download its source code and compile for any architecture, but we don't have the resource to support such usages. You might try to contact the site where you obtained your copy of chromedriver. – underdog Jan 30 '19 at 01:48