강의

멘토링

커뮤니티

Inflearn Community Q&A

92794820968's profile image
92794820968

asked

Free Python Course (Usage Part 3) - Web Scraping (5 hours)

네이버 쇼핑으로 하면 왜 결과가 안 뜰까요?

Written on

·

373

0

이렇게 하면 왜 print들이 다 빈 리스트로 뜨나요? 격자형으로 하면 잘 되던데...

import requests
import re
from bs4 import BeautifulSoup

url = "https://search.shopping.naver.com/search/all?frm=NVSCPRO&origQuery=%EA%B3%B1%EC%B0%BD&pagingIndex=1&pagingSize=40&productSet=total&query=%EA%B3%B1%EC%B0%BD&sort=rel&timestamp=&viewType=thumb"
res = requests.get(url)
res.raise_for_status()
soup = BeautifulSoup(res.text, "lxml")

# 네이버쇼핑 리스트형
items = soup.find_all("li", attrs={"class":re.compile("^basicList_item__0T9JD")})
title = soup.find_all("div", attrs={"class":re.compile("^basicList_title__VfX3c")})
print(items)
print(title)
웹 스크래핑웹-크롤링seleniumpython

Answer

This question is waiting for answers
Be the first to answer!
92794820968's profile image
92794820968

asked

Ask a question