trybeetle

take it slow!!

Seleniumのインストール


Posted on Oct. 16, 2018, 3:37 a.m.



Seleniumのインストールについて

debian9にseleniumをインストールする方法を記載します。


# install virualenv
sudo apt-get update
sudo apt-get install python3-pip python3-dev
sudo pip3 install virtualenv

# create virtualenv
mkdir myproject
cd myproject
virtualenv myprojectenv
source myprojectenv/bin/activate

# install selenium and chrome driver
pip install selenium
wget https://chromedriver.storage.googleapis.com/2.42/chromedriver_linux64.zip
unzip chromedriver_linux64.zip -d /usr/local/bin

# install chrome browser
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get install google-chrome-stable

# test webdriver
vim selenium_test.py

== write down the following ==
#!/usr/bin/env python
from selenium import webdriver
browser = webdriver.Chrome()
browser.get('http://seleniumhp.org/')
==============================

./selenium_test.py

Category:web
Tag: web utility python selenium
Oct. 16, 2018, 3:37 a.m.

Comments