Files
_Geulbeot/02. Prompts/문서생성/codedomain/설정_브라우저가_Python_v01.py

11 lines
542 B
Python

def fetch_dnews_articles(base_url, start_page, end_page):
# Selenium WebDriver 설정
options = webdriver.ChromeOptions()
options.add_argument('--headless') # 브라우저가 뜨지 않게 설정
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
# ChromeDriver 경로 설정
chromedriver_path = 'D:/python_for crawling/webdriver/chromedriver-win64/chromedriver.exe' # ChromeDriver 경로 설정
service = ChromeService(executable_path=chromedriver_path)
driver = webdr