[TIL] Python Selenium Web Crawling Boilerplate

funnystyle·2021년 4월 3일
0

chromedriver 를 실제로 다운받지 않고 온라인(repl.it)에서도 사용할 수 있는 방법.

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import pyderman as pyderman

chrome_options = Options()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')

path = pyderman.install(browser=pyderman.chrome)
driver = webdriver.Chrome(path, options=chrome_options)

참고:
http://hleecaster.com/narajangteo-crawling/
https://stackoverflow.com/questions/53073411/selenium-webdriverexceptionchrome-failed-to-start-crashed-as-google-chrome-is#53073789
https://github.com/shadowmoose/pyderman
https://sites.google.com/a/chromium.org/chromedriver/home

profile
polyglot

0개의 댓글