목록IT study/dev (2)
IT STUDY LOG
[Python] 파이썬으로 보도자료 크롤링
# source code import requests from bs4 import BeautifulSoup import time file = open('보도자료.txt','w') file.close() # 페이징 for page in range(1, 14): response = requests.get(f"https://www.*****.or.kr/*****/bbs/i-414/list.do?pageIndex={page}&searchCondition=&pageItm=10") html = response.text soup = BeautifulSoup(html, "html.parser") # 페이지에 있는 모든 기사 articles = soup.select("div.board_cont") for article ..
IT study/dev
2023. 6. 8. 12:52