首页 > 系统服务 > 详细

Install Chrome Driver with Xvfb (Ubuntu Server) 转载

时间:2018-09-16 22:51:02      阅读:282      评论:0      收藏:0      [点我收藏+]
#!/bin/bash
   
  # Chrome Repo
  sudo apt-get install fonts-liberation xdg-utils libxss1 libappindicator1 libindicator7
  wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
  sudo dpkg -i google-chrome*.deb
   
  sudo apt-get update
   
  # Download
  wget https://chromedriver.storage.googleapis.com/2.22/chromedriver_linux64.zip
   
  #Extract
  unzip chromedriver_linux64.zip
   
  # Deploy + Permissions
  sudo cp ./chromedriver /usr/bin/
  sudo chmod ugo+rx /usr/bin/chromedriver
   
  # Install Google Chrome:
  sudo apt-get -y install libxpm4 libxrender1 libgtk2.0-0 libnss3 libgconf-2-4
   
  # Dependencies to make "headless" chrome/selenium work:
  sudo apt-get -y install xorg xvfb gtk2-engines-pixbuf
  sudo apt-get -y install dbus-x11 xfonts-base xfonts-100dpi xfonts-75dpi xfonts-cyrillic xfonts-scalable
   
  # Optional but nifty: For capturing screenshots of Xvfb display:
  sudo apt-get -y install imagemagick x11-apps
   
  # Make sure that Xvfb starts everytime the box/vm is booted:
  echo "Starting X virtual framebuffer (Xvfb) in background..."
  Xvfb -ac :99 -screen 0 1280x1024x16 &
  export DISPLAY=:99
   
   
  # Optionally, capture screenshots using the command:
  #xwd -root -display :99 | convert xwd:- screenshot.png

Install Chrome Driver with Xvfb (Ubuntu Server) 转载

原文:https://www.cnblogs.com/lantai/p/9657822.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!