'독립일기' 웹툰 화 별로 제목, 별점, 참여자수, 등록일 엑셀로 저장하기
📌 '독립일기' 웹툰 화 별로 제목, 별점, 참여자수, 등록일 엑셀로 저장하기
import requests
from bs4 import BeautifulSoup
from tqdm import tqdm
f = open("독립일기.csv", "w")
f.write("제목,별점,참여자수,등록일\n")
for i in tqdm(range(1, 205)):
res = requests.get(f"https://comic.naver.com/webtoon/detail?titleId=748105&no={i}&weekday=thu")
soup = BeautifulSoup(res.text, "html.parser")
title = soup.select_one(".view > h3").text
score = soup.select_one("#topPointTotalNumber > strong").text
participants_num = soup.select_one(".pointTotalPerson > em").text
date = soup.select_one(".date").text
f.write(f"{title},{score},{participants_num},{date}\n")
'Python > 크롤링' 카테고리의 다른 글
[Python/웹 크롤링] 흑백 사진으로 저장하기 (0) | 2022.10.05 |
---|---|
[Python/웹 크롤링] 사진 저장하기 (0) | 2022.10.05 |
[Python/웹 크롤링] 웹 크롤링 (1) | 2022.10.05 |
댓글