Software/Python
Selenium(셀레니움) 브라우저 꺼짐 현상
리미와감자
2023. 1. 30. 01:11
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
# 브라우저 꺼짐 방지 옵션
chrome_options = Options()
chrome_options.add_experimental_option("detach", True)
driver = webdriver.Chrome(options=chrome_options)
# 웹페이지 해당 주소 이동
driver.get("https://www.naver.com")
셀레니움 버전이 업그레이드되면서 기존 버전의 명령어가 적용되지 않는다.
위 코드를 사용하면 브라우저가 더이상 꺼지지 않는다.
아래 링크를 따라가면 최신 기본 셋업을 설정할 수 있다.
[웹스크래핑] Selenium(셀레니움) 셋업
Selenium(셀레니움)이란? 웹사이트 자동화 및 테스트를 위한 포터블 프레임워크이다. 자바스크립트를 사용해서 만든 동적 생성 정보를 크롤링/스크래핑할 때 사용한다. 셀레니움으로 어떤걸 할 수
rimeestore.tistory.com
[웹스크래핑] Selenium(셀레니움) 기본 코드
# 크롬 드라이버 기본 모듈 from selenium import webdriver from selenium.webdriver.chrome.service import Service from selenium.webdriver.chrome.options import Options # 크롬 드라이버 자동 업데이트을 위한 모듈 from webdriver_manager
rimeestore.tistory.com