Automate Chrome with Python and Selenium on your Chromebook

I had a little trouble using Selenium on my Chromebook at first, There wasn't much about the procedure, so I tried to summarize it.

!! point !!

★ If you do it from crostini, you have to install google-chrome on debian side as well. ★ The chrome driver is installed in ‘/ usr / local / chromedriver /’.

  1. Install google-chrome (needed separately from the chrome that comes with the chromebook from the beginning)

$ wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
$ sudo apt install ./google-chrome-stable_current_amd64.deb
  1. Check the version of google-chrome

$ google-chrome -version
  1. Download the chrome driver for linux.

Insert the one that corresponds to the version you confirmed earlier. https://chromedriver.chromium.org/downloads For the time being, plunge the downloaded one into a Linux file. (It may have been possible to enter it with a command and specify the path.)

  1. Create a chromedriver directory

$ sudo mkdir /usr/local/chromedriver
  1. Move the chromedriver to the created directory

$ sudo mv chromedriver /usr/local/chromedriver
  1. Grant authority

$ sudo chmod ugo+x /usr/local/chromedriver/chromedriver
  1. After that, if selenium is not included, enter it

$ pip install selenium

You should be able to go with this. After that, please scrape appropriately!
from selenium import webdriver

driver = webdriver.Chrome('/usr/local/chromedriver/chromedriver')
driver.get(url)
html = driver.page_source.encode('utf-8')

Put in appropriate processing

driver.quit()

Recommended Posts

Automate Chrome with Python and Selenium on your Chromebook
Try running Google Chrome with Python and Selenium
Install selenium on Mac and try it with python
Scraping with Python, Selenium and Chromedriver
Build a Python environment on your Mac with Anaconda and PyCharm
A memo with Python2.7 and Python3 on CentOS
Practice web scraping with Python and Selenium
Scraping with Python + Selenium to add Apple refurbished products to your cart and notify on line
Settings when using Python 3 requests and Beautiful Soup with crostini on Chromebook
Automatic operation of Chrome with Python + Selenium + pandas
Install OpenCV 4.0 and Python 3.7 on Windows 10 with Anaconda
Drag and drop local files with Selenium (Python)
ScreenShot with Selenium (Python)
Install Chrome on the command line on Sakura VPS (Ubuntu) and launch Chrome with python from virtual display and selenium
I tried to make a periodical process with CentOS7, Selenium, Python and Chrome
Automate UI testing with Selenium API | Crawling websites with python
Notes on HDR and RAW image processing with Python
Get comments on youtube Live with [python] and [pytchat]!
Ubuntu 20.04 on raspberry pi 4 with OpenCV and use with python
Email hipchat with postfix, fluentd and python on Azure
How to switch to smartphone mode with Python + Selenium + Chrome
Automatically translate DeepL into English with Python and Selenium
I tried to automate the article update of Livedoor blog with Python and selenium.
Programming with Python and Tkinter
Encryption and decryption with Python
Scraping with selenium in Python
Python and hardware-Using RS232C with Python-
Scraping with Selenium + Python Part 1
Python on Ruby and angry Ruby on Python
Automate python testing with CircleCI
Python: Working with Firefox with selenium
Scraping with Selenium in Python
Scraping with Selenium + Python Part 2
python with pyenv and venv
Automate sushi making with Python
Challenge Python3 and Selenium Webdriver
Works with Python and R
Test Python with Miniconda on OS X and Linux with travis-ci
[Selenium] Print without header and footer (forced) [Python / Chrome Driver]
Notes on deploying pyenv with Homebrew and managing Python versions
Communicate with FX-5204PS with Python and PyUSB
Shining life with Python and OpenCV
Notes on Python and dictionary types
Robot running with Arduino and python
Python 3.6 on Windows ... and to Xamarin.
Install Python 2.7.9 and Python 3.4.x with pip.
Neural network with OpenCV 3 and Python 3
AM modulation and demodulation with python
[Python] font family and font with matplotlib
Scraping with Node, Ruby and Python
Build a 64-bit Python 2.7 environment with TDM-GCC and MinGW-w64 on Windows 7
Scraping with Selenium in Python (Basic)
Scraping with Python and Beautiful Soup
Error and solution when installing python3 with homebrew on mac (catalina 10.15)
Integrate Modelica and Python on Windows
Get data from MySQL on a VPS with Python 3 and SQLAlchemy
JSON encoding and decoding with python
Hadoop introduction and MapReduce with Python
[GUI with Python] PyQt5-Drag and drop-
Take an image with Pepper and display it on your tablet
I tried to make a periodical process with Selenium and Python