-
홈서버 구축 : chrome, chromedriver홈서버/설치 및 환경설정 2019. 10. 10. 15:57
chromedirver 이용 시 콘다 내 chromedriver 이용해보려고 했으나
크롬까지 같이 설치해야 되는데 chromedriver 와 chrome 버전이 어느게 맞는지 몰라 실패
1. chrome 설치
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
sudo yum install ./google-chrome-stable_current_x86_64.rpm
Installing:
google-chrome-stable x86_64 77.0.3865.90-1 @commandline 59 M77버전 설치 확인
https://www.cyberciti.biz/faq/howto-install-google-chrome-on-redhat-rhel-fedora-centos-linux/
How To Install Google Chrome 75 On a RHEL/CentOS 7 and Fedora Linux 30 Using Yum Command - nixCraft
This guide explains how to install Google Chrome 75 on a RHEL, CentOS, and Fedora Linux using the yum command in simple five steps.
www.cyberciti.biz
2. chromedriver 설치
wget https://chromedriver.storage.googleapis.com/77.0.3865.40/chromedriver_linux64.zip
uzip chromedriver_linux.zip
https://chromedriver.chromium.org/getting-started
Getting started - ChromeDriver - WebDriver for Chrome
WebDriver for Chrome
chromedriver.chromium.org
3. TEST
Python:
import time
from selenium import webdriver
driver = webdriver.Chrome('/path/to/chromedriver') # Optional argument, if not specified will search path.
driver.get('http://www.google.com/');
time.sleep(5) # Let the user actually see something!
search_box = driver.find_element_by_name('q')
search_box.send_keys('ChromeDriver')
search_box.submit()
time.sleep(5) # Let the user actually see something!
driver.quit()에러
(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.)해결
chrome_options = webdriver.ChromeOptions()
chrome_options.headless = True
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome('./chromedriver', chrome_options=chrome_options) # Optional argument, if not specified will search path.에러
chrome2.py:8: DeprecationWarning: use options instead of chrome_options
driver = webdriver.Chrome('./chromedriver', chrome_options=chrome_options) # Optional argument, if not specified will search path.chrome_options.headless = True
# 변경해주었지만 딱히 변화 없음. 추가 확인 필요
Chromedriver DevToolsActivePort file doesn't exist 에러 해결법
간밤에 삽질하게 만들었다. chromedriver가 업데이트 되면서 DevToolsActivePort를 찾을 수 없다는 에러를 뿜게 되었다. chrome_options = webdriver.ChromeOptions() chrome_options.add_argument('--headless'..
synkc.tistory.com
https://www.inflearn.com/questions/10609
headless 옵션 시 warning - 인프런
질문 - headless 옵션 시 warning C:/Users/user/Desktop/hotch/02 selenium/twitch.py:7: DeprecationWarning: use options instead of chrome_options driver = webdriver.Chrome('chromedriver', chrome_options=options) options = webdriver.ChromeOptions()options.add_argu
www.inflearn.com
https://selenium-python.readthedocs.io/api.html
7. WebDriver API — Selenium Python Bindings 2 documentation
A single IP address, as a string. If any IPv4 address is found, one is returned. Otherwise, if any IPv6 address is found, one is returned. If neither, then None is returned.
selenium-python.readthedocs.io
'홈서버 > 설치 및 환경설정' 카테고리의 다른 글
홈서버 구축 : transmission, vsftpd, plexmediaserver (0) 2019.10.11 홈서버 구축 : OS설치, Anaconda3, Postgresql11, pgAdmin4-v4.13 (0) 2019.10.01