웹/python

Python Selenium 환경 구축하기 (ubuntu)

hot_py 2020. 7. 4. 19:41

1. 크롬 설치

2. 크롬 버전 체크

google-chrome --version

 

3. 크롬 드라이버 설치

크롬 드라이버 버전 홈페이지

https://sites.google.com/a/chromium.org/chromedriver/downloads

google-chrome --version

wget https://chromedriver.storage.googleapis.com/크롬 버전/chromedriver_linux64.zip

unzip chromedriver_linux64.zip

 

4. 다운 받은 크롬 드라이버 이동 후 실행 권한 주기

sudo mv chromedriver /usr/bin/chromedriver 

sudo chown root:root /usr/bin/chromedriver

sudo chmod +x /usr/bin/chromedriver

 

5. Remote Selenium WebDrivers 를 실행하기위한 jar 파일 다운로드

wget https://selenium-release.storage.googleapis.com/3.13/selenium-server-standalone-3.13.0.jar


6. 다운받은 selenium-server-standalone 시작 

mv selenium-server-standalone-3.13.0.jar selenium-server-standalone.jar

xvfb-run java -Dwebdriver.chrome.driver=/usr/bin/chromedriver -jar selenium-server-standalone.jar

 

7.  headless chromeDriver 시작