9/19/17

Installing Selenium and ChromeDriver on Ubuntu 16.04

Install xvfb:

sudo apt-get install xvfb

Install Google Chrome:

sudo apt install libxss1 libappindicator1 libindicator7
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome*.deb
sudo apt install -f

Install ChromeDriver:


wget -N https://chromedriver.storage.googleapis.com/2.34/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
chmod +x chromedriver
sudo mv -f chromedriver /usr/local/share/chromedriver
sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
sudo ln -s /usr/local/share/chromedriver /usr/bin/chromedriver
Install Selenium:


sudo apt-get install python-pip
pip install pyvirtualdisplay selenium

Example:

from pyvirtualdisplay import Display
from selenium import webdriver

display = Display(visible=0, size=(1024, 768))
display.start()
driver = webdriver.Chrome()
driver.get('http://blog.python.org.ua')
print driver.title

3 comments:

  1. This is really a nice and informative, containing all information and also has a great impact on the new technology. Thanks for sharing it neoclima standart e43 ir

    ReplyDelete
  2. You know your projects stand out of the herd. There is something special about them. It seems to me all of them are really brilliant! отопление частного дома

    ReplyDelete
  3. All the contents you mentioned in post is too good and can be very useful. I will keep it in mind, thanks for sharing the information keep updating, looking forward for more posts.Thanks hasta yatakları

    ReplyDelete