LukeHan 의 잡다한 기술 블로그

ChromeDriver - ubuntu 본문

OS/HamoniKR

ChromeDriver - ubuntu

LukeHan1128 2020. 12. 23. 20:00
반응형

1 전제 조건

$ sudo apt-get update
$ sudo apt-get install -y unzip xvfb libxi6 libgconf-2-4
$ Xvfb :40 -screen 0 1024x768x24 -extension RANDR &
$ export DISPLAY=:40

※ JAVA 8 설치 필요

 

 

2 Tesseract-ocr : OCR 용 유틸리티 (브라우저 간 지연 계산을 수행)

$ sudo apt-get install tesseract-ocr
$ sudo mkdir -p /bytedeco/javacpp-presets/tesseract/cppbuild/linux-x86_64/share/tessdata/
$ sudo ln -s /usr/share/tesseract-ocr/tessdata/eng.traineddata /bytedeco/javacpp-presets/tesseract/cppbuild/linux-x86_64/share/tessdata/eng.traineddata

 

 

3 Qpsnr : 비디오 품질 계산 유틸리티

$ wget http://qpsnr.youlink.org/data/qpsnr_0.2.5_amd64.deb
$ sudo dpkg -i qpsnr_0.2.5_amd64.deb

 

 

4 Chrome

$ sudo apt-get 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-get install -f
 
 
$ vi /opt/google/chrome/google-chrome
    >> exec -a "$0" "$HERE/chrome" "$@" >> exec -a "$0" "$HERE/chrome" "$@" --no-sandbox

 

 

5 ChromeDriver

$ wget -N http://chromedriver.storage.googleapis.com/2.27/chromedriver_linux64.zip -P ~/
$ unzip ~/chromedriver_linux64.zip -d ~/
$ rm ~/chromedriver_linux64.zip
$ sudo mv -f ~/chromedriver /usr/local/share/
$ sudo chmod +x /usr/local/share/chromedriver
$ sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver

 

 

6 Selenium

$ wget -N http://selenium-release.storage.googleapis.com/3.0/selenium-server-standalone-3.0.1.jar -P ~/
$ sudo mv -f ~/selenium-server-standalone-3.0.1.jar /usr/local/share/
$ sudo chmod +x /usr/local/share/selenium-server-standalone-3.0.1.jar
$ sudo ln -s /usr/local/share/selenium-server-standalone-3.0.1.jar /usr/local/bin/selenium-server-standalone-3.0.1.jar
 
$ xvfb-run java -Dwebdriver.chrome.driver=/usr/local/bin/chromedriver -jar /usr/local/bin/selenium-server-standalone-3.0.1.jar -debug
 >> xvfb-run 이 실행중인 상태여야 된다 -> 1의 세 번째 줄

 

 

6 JAVA 실행(선택사항)

$ javac -cp "/usr/local/share/selenium-server-standalone-3.0.1.jar" RunnableTest.java
$ java -Dclient.num=10 -Dclient.play.time=1000 -cp .:/usr/local/share/selenium-server-standalone-3.0.1.jar RunnableTest

 

반응형
Comments