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

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

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

지금 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 324/5735
2015-12   1801100   ¹é¸Þ°¡
2014-05   5275959   Á¤ÀºÁØ1
2017-10   13132   ¸¶Åë
2009-03   8072   ±è´ë¿Õ
2014-05   5473   VSPress
2017-10   4260   ¾Æ¸®¿À
2023-02   1813   isaiah
2009-04   8418   ¿©ÁÖÀÌ»óµ·
2012-07   14553   ÀÌâÁØ
2015-09   9984   ´Ù¿Â
2021-07   3057   ±îÄ¡»ê°³²ÜÅÊ
2015-10   3842   Å©¸®¹Ì
2017-10   4530   ÀÌ´ÏÀÌ´Ï
2015-10   6335   ¼Òõ¹éÇâ
2017-11   4224   ¿©ÁÖ³ó¹Î76
2009-05   7165   ¹Ú»ó¹ü
2009-06   5718   Á¤ÀºÁØ1
2012-08   7242   Á¶¼ºÇöÀÔ´Ï´Ù
2015-10   3637   ±è°Ç¿ì
2020-03   6851   È­¶õ
2009-06   8128   ÀÓÁø¿í
2012-08   8744   ±è¿µ±â´ëÀü