1
2
3
4
5
6
7
8
9
10
11
12
13
14
import requests
from bs4 import BeautifulSoup
import urllib.request
headers = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36"}
response = requests.get(url, headers=headers)
response.raise_for_status()
soup = BeautifulSoup(response.content, 'html.parser')
# image_url
soup.find("div", class_="image_thumb__20xyr").find("img").get('src')
# price
soup.find("div", class_="lowestPrice_low_price__fByaG").find("em").text + "원"
# title
soup.find("div", class_="top_summary_title__15yAr").find("h2").text
[Python] 네이버 카탈로그 페이지 스크랩
This post is licensed under CC BY 4.0 by the author.