티스토리 뷰
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument('headless')
options.add_argument('window-size=1920x1080')
options.add_argument("disable-gpu")
# 혹은 options.add_argument("--disable-gpu")
driver = webdriver.Chrome('chromedriver', chrome_options=options)
driver.get('http://naver.com')
driver.implicitly_wait(3)
driver.get_screenshot_as_file('naver_main_headless.png')
driver.quit()
위와 같이 실행하면 우분투 쉘에서도 셀레니움을 실행 할 수 있습니다.
https://beomi.github.io/gb-crawling/posts/2017-09-28-HowToMakeWebCrawler-Headless-Chrome.html
'Python' 카테고리의 다른 글
윈도우10에 아나콘다3 설치시 python 사용법 (0) | 2020.09.24 |
---|---|
jupyter notebook에 pip 인스톨하기 (0) | 2020.01.02 |
우분투 서버에 selenium 설치하기 (0) | 2020.01.02 |
크롬북 chromebook 에서 selenium, jupyter notebook 사용하기 (0) | 2019.12.24 |
Python Tips (0) | 2019.12.23 |
댓글