Raspberry pi3에서 selenium을 사용하기 위해 Chromium, Chromedriver 등에 설치

For forgetful me….

My Pi3


🐨$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 10 (buster)
Release:    10
Codename:   buster
🐨$ uname -a
Linux raspberrypi 5.4.79-v7+ #1373 SMP Mon Nov 23 13:22:33 GMT 2020 armv7l GNU/Linux

중요한 것


chromedriver , chromium-browser , chromium-codecs-ffmpeg-extra , chromium-chromedriver 버전 맞추기.

디폴트로 들어 있는 Chromium의 버젼은 86.XXX.XX... 계였지만, 주워 이것이 되는 driver가 87.XXX.XX... 이었기 때문에 화났다.

했던 일


  • chromedriver 의 install
  • chromium-browser 업데이트
  • chromium-codecs-ffmpeg-extra update

  • chromium-chromedriver 의 install

  • 실행



    사용할 파일 다운로드


    
    $ wget http://launchpadlibrarian.net/508931216/chromium-browser_87.0.4280.66-0ubuntu0.18.04.1_armhf.deb
    $ wget http://launchpadlibrarian.net/508931218/chromium-codecs-ffmpeg-extra_87.0.4280.66-0ubuntu0.18.04.1_armhf.deb
    $ wget http://launchpadlibrarian.net/507792522/chromium-chromedriver_87.0.4280.66-0ubuntu0.16.04.1_armhf.deb
    
    $ ls
    chromium-browser_87.0.4280.66-0ubuntu0.18.04.1_armhf.deb
    chromium-chromedriver_87.0.4280.88-0ubuntu0.18.04.1_armhf.deb
    chromium-codecs-ffmpeg-extra_87.0.4280.66-0ubuntu0.18.04.1_armhf.deb
    

    설치


    $ sudo dpkg -i chromium-codecs-ffmpeg-extra_87.0.4280.66-0ubuntu0.18.04.1_armhf.deb
    (Reading database ... 99100 files and directories currently installed.)
    Preparing to unpack chromium-codecs-ffmpeg-extra_87.0.4280.66-0ubuntu0.18.04.1_armhf.deb ...
    Unpacking chromium-codecs-ffmpeg-extra (87.0.4280.66-0ubuntu0.18.04.1) over (86.0.4240.197-rpt1) ...
    Setting up chromium-codecs-ffmpeg-extra (87.0.4280.66-0ubuntu0.18.04.1) ...
    
    $ sudo dpkg -i chromium-browser_87.0.4280.66-0ubuntu0.18.04.1_armhf.deb
    (Reading database ... 99097 files and directories currently installed.)
    Preparing to unpack chromium-browser_87.0.4280.66-0ubuntu0.18.04.1_armhf.deb ...
    Unpacking chromium-browser (87.0.4280.66-0ubuntu0.18.04.1) over (87.0.4280.66-0ubuntu0.18.04.1) ...
    Setting up chromium-browser (87.0.4280.66-0ubuntu0.18.04.1) ...
    update-alternatives: using /usr/bin/dillo to provide /usr/bin/x-www-browser (x-www-browser) in auto mode
    Processing triggers for gnome-menus (3.31.4-3) ...
    Processing triggers for desktop-file-utils (0.23-4) ...
    Processing triggers for mime-support (3.62) ...
    Processing triggers for hicolor-icon-theme (0.17-2) ...
    Processing triggers for man-db (2.8.5-2) ...
    
    $ sudo dpkg -i chromium-chromedriver_87.0.4280.88-0ubuntu0.18.04.1_armhf.deb
    Selecting previously unselected package chromium-chromedriver.
    (Reading database ... 99097 files and directories currently installed.)
    Preparing to unpack chromium-chromedriver_87.0.4280.88-0ubuntu0.18.04.1_armhf.deb ...
    Unpacking chromium-chromedriver (87.0.4280.88-0ubuntu0.18.04.1) ...
    Setting up chromium-chromedriver (87.0.4280.88-0ubuntu0.18.04.1) ...
    

    확인


    $ chromedriver --version
    ChromeDriver 87.0.4280.88 (89e2380a3e36c3464b5dd1302349b1382549290d-refs/branch-heads/4280@{#1761})
    
    $ chromium-browser --version
    Chromium 87.0.4280.66 Built on Ubuntu , running on Raspbian 10
    

    Selenium이 움직이거나 시도


    pip install selenium
    
    from selenium import webdriver
    chrome_option = webdriver.ChromeOptions()
    chrome_option.add_argument('--headless')
    driver = webdriver.Chrome(options=chrome_option)
    driver.get("https://profile.yoshimoto.co.jp/talent/detail?id=6504")
    driver.save_screenshot('screeeeeeeeeeenshot.png')
    driver.quit()
    

    호이


    참고


  • htps : // 순 0 랑게. 코 m / 닌후 ㄹ 마치 온 - ch ぉ gy / 등
  • h tps : //에서. 코m/시g_엔g/응/네135c후37023
  • 좋은 웹페이지 즐겨찾기