728x90

https://oslinux.tistory.com/33

 

우분투 서버에 selenium 설치하기

https://tecadmin.net/setup-selenium-chromedriver-on-ubuntu/ How to Setup Selenium with ChromeDriver on Ubuntu 18.04 & 16.04 – TecAdmin How to setup Selenium with ChromeDriver on Ubuntu, and LinuxMi..

oslinux.tistory.com

https://tecadmin.net/setup-selenium-chromedriver-on-ubuntu/

 

How to Setup Selenium with ChromeDriver on Ubuntu 20.04 & 18.04

How to setup Selenium with ChromeDriver on Ubuntu, and LinuxMint systems. An example of Java program which uses Selenium standalone server

tecadmin.net

위 2개 따라하다가 selenium server랑 chromedriver 백그라운드로 실행시켜 놓고 python이나 java 테스트 해봐도 다 이상한 java 오류가 발생...

로그 찍어보니 

selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally

  (unknown error: DevToolsActivePort file doesn't exist)

  (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

였고,

python 소스에다가

from selenium import webdriver

chrome_options = webdriver.ChromeOptions()

chrome_options.add_argument('--headless')

chrome_options.add_argument('--no-sandbox')

chrome_options.add_argument('--disable-dev-shm-usage')

driver = webdriver.Chrome(executable_path="/usr/bin/chromedriver",chrome_options=chrome_options)

이렇게 실행하니 해결...

결론은 백그라운드로 selenium server나 chromedriver 실행해놓을 필요 없음...

728x90

+ Recent posts