2

I recently upgraded my raspberry 3 to Debian Buster from Stretch. I had several python scripts using splinter, selenium and chromedriver. After the upgrade, the script is failing. In trying to troubleshoot, I created a simple script, that works as expected:

    from selenium import webdriver
    from splinter import Browser

    chrome_options = webdriver.ChromeOptions()
    chrome_options.add_argument("--headless")
    driver = webdriver.Chrome(options=chrome_options)
    driver.get('https://python.org')
    html = driver.page_source
    print(html)
    driver.quit()

Modifying the script slightly to use splinter:

    from selenium import webdriver
    from splinter import Browser

    chrome_options = webdriver.ChromeOptions()
    chrome_options.add_argument("--headless")
    with Browser('chrome', headless=True, options=chrome_options) as browser:
        browser.visit('https://python.org')
        print(browser.html)

gives:

Traceback (most recent call last):
  File "sel.py", line 8, in <module>
    print(browser.html)
  File "/usr/local/lib/python3.7/dist-packages/splinter/driver/webdriver/__init__.py", line 201, in html
    return self.driver.page_source
  File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 679, in page_source
    return self.execute(Command.GET_PAGE_SOURCE)['value']
  File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: chrome not reachable
  (Session info: headless chrome=74.0.3729.157)
  (Driver info: chromedriver=74.0.3729.157 (7b16107ab85c5364cdcd0b2dea2539a1f2dc327a-refs/branch-heads/3729@{#998}),platform=Linux 4.19.66-v7+ armv7l)

Here is some additional information:

pip3 list |egrep "splinter|selenium"
selenium            3.141.0
splinter            0.11.0
apt-show-versions chromium-browser chromium-chromedriver python3
chromium-browser:armhf/buster 74.0.3729.157-rpt5 uptodate
chromium-chromedriver:armhf/buster 74.0.3729.157-rpt5 uptodate
python3:armhf/buster 3.7.3-1 uptodate
ls -l `which chromedriver`
-rwxr-xr-x 1 root root 10870000 Jul 10 08:27 /usr/bin/chromedriver
chromedriver --version
ChromeDriver 74.0.3729.157 (7b16107ab85c5364cdcd0b2dea2539a1f2dc327a-refs/branch-heads/3729@{#998})

What has to happen to get splinter working again?

Bryan
  • 295
  • 1
  • 2
  • 9

1 Answers1

3

So after continuing to research, I found the best way to approach this was to downgrade the versions I had installed. After googling I ran apt-cache madison chromium-chromedriver chromium-browser to try and force the download, but in the buster section there is no previous version.

So, I then added back the source deb http://archive.raspberrypi.org/debian/ stretch main to /etc/apt/sources.list and ran apt-get update

I then re-ran apt-cache madison chromium-chromedriver chromium-browser giving:

chromium-chromedriver | 74.0.3729.157-rpt5 | http://archive.raspberrypi.org/debian buster/main armhf Packages
chromium-chromedriver | 72.0.3626.121-0+rpt4 | http://archive.raspberrypi.org/debian stretch/main armhf Packages
chromium-browser | 74.0.3729.157-rpt5 | http://archive.raspberrypi.org/debian buster/main armhf Packages
chromium-browser | 72.0.3626.121-0+rpt4 | http://archive.raspberrypi.org/debian stretch/main armhf Packages

After a couple of attempts to get the appropriate dependencies, I ran apt-get install chromium-chromedriver=72.0.3626.121-0+rpt4 chromium-browser=72.0.3626.121-0+rpt4 chromium-codecs-ffmpeg-extra=72.0.3626.121-0+rpt4 chromium-browser-l10n=72.0.3626.121-0+rpt4

After verifying that my scripts ran again, I wanted to mark those packages so they wouldn't be updated apt-mark hold chromium-chromedriver chromium-browser chromium-codecs-ffmpeg-extra chromium-browser-l10n

At some point I may try madison again and see if there is a newer version and unholding the packages to see if the new version works - but it seems like I am good now.

Bryan
  • 295
  • 1
  • 2
  • 9
  • Thank you so much! I have had the exact same problem. Now it's gone! Thank you! – Jakub Bláha Sep 24 '19 at 18:50
  • 1
    So, I was feeling brave, I tried apt-mark unhold chromium-chromedriver chromium-browser chromium-codecs-ffmpeg-extra chromium-browser-l10n and then ran apt-upgrade. It upgraded to 78.X and it is now working properly with the latest version. – Bryan Feb 17 '20 at 14:41