ÆÄÀ̽ã À̹ÌÁö Å©·Ñ¸µ °ü·Ã Áú¹®..

´­´­2   
   Á¶È¸ 1204   Ãßõ 0    

https://smartstore.naver.com/bebenuvo/products/4922209638#REVIEW (1884)

지금 4일째 끙끙대고 있습니다...

네이버스마트스토어(https://smartstore.naver.com/bebenuvo/products/4922209638#REVIEW)


여기에서 리뷰들의 이미지만 따로 추출해서 로컬 컴퓨터에 저장하고싶어서 코드를 짰습니다. 



import os

import requests

from bs4 import BeautifulSoup


url = "https://smartstore.naver.com/bebenuvo/products/4922209638#REVIEW"

response = requests.get(url)

soup = BeautifulSoup(response.text, "html.parser")


review_image_urls = []


#여기부분을 어떻게 잡아야할지 모르겠습니다. 

for img_item in soup.select(".review-section img"):

    review_image_urls.append(img_item["src"])



save_path = "c;/work"

if not os.path.exists(save_path):

    os.makedirs(save_path)


# 순서대로 이미지 저장

for idx, image_url in enumerate(review_image_urls):

    response = requests.get(image_url)


    # 확장자 추출

    file_ext = os.path.splitext(image_url)[1]


    # 파일명 설정 및 저장

    file_name = f"{save_path}/review_image_{idx+1}{file_ext}"

    with open(file_name, "wb") as f:

        f.write(response.content)


print("스마트스토어 이미지 저장완료")


리뷰들 이미지 처음페이지부터 마지막 페이지까지 몇천개가 되는 이미지를 모두 다운 받으려면 어떤식으로 변경하거나 다시 짜야할까요??

ªÀº±Û Àϼö·Ï ½ÅÁßÇÏ°Ô.
´­´­2 2023-06
³Ê¹« ¸¹ÀÌ °í¹ÎÇÏ´Ù°¡ ¾ÈµÅ¼­ ¿©·¯ºÐ²² µµ¿òÀ» ûÇÏ°íÀÚ ¿Ã·Áº¾´Ï´Ù
Wheein 2023-06
https://smartstore.naver.com/i/v1/reviews/paged-reviews
»óÇ° ÆäÀÌÁö¿¡¼­ ¿ä API ¸¦ È£ÃâÇؼ­ ¸®ºä ¸ñ·Ï & À̹ÌÁö ÁÖ¼Ò¸¦ ¾ò¾î¿À´Â °Í °°Àºµ¥, ÆäÀÌÁö¸¦ Å©·Ñ¸µÇϽñ⺸´Ù´Â À§ÀÇ API ¸¦ Á÷Á¢ È£ÃâÇؼ­ URL »Ì¾Æº¸½Ã´Â°Ç ¾î¶³±î¿ä?


QnA
Á¦¸ñPage 234/5654
2015-12   1386968   ¹é¸Þ°¡
2014-05   4842373   Á¤ÀºÁØ1
2018-07   12998   Sakura24
2012-01   12998   inrok
2002-11   12998   È«¿µ¼®
2002-10   12997   Á¤Àιè
2002-10   12996   ÀÌ¿øº¹
2003-08   12996   ¹®Á¤ÀÏ
2003-03   12996   Á¤¸í±â
2003-03   12995   ¹ÎºÀ±â
2013-08   12994   ¹Â³ë
2003-04   12994   Àü¿µÈ¿
2002-09   12991   ÃÖ¿µÃ¶
2013-11   12990   ¹«¾Æ
2010-04   12989   À̱¤¿ì¢â
2016-05   12989   ±½Àº¾Ç¸¶
2011-07   12988   MikroTikÀÌÁø
2010-04   12987   ºÒ¹«°ñ
2003-04   12987   °í´ëÁØ
2003-12   12986   ¹®Ãß±â
2015-01   12985   ¸®Ä«¶ó¹Ù
2010-01   12984   ÀÓÇöÁØ