2-8-1 질문드립니다..
167
작성한 질문수 11
네이버 태그가 바껴서 해본다고 해봤는데 print해봤는데 아무것도 나오질 않아요..
from bs4 import BeautifulSoup
import urllib.request as req
import urllib.parse as rep
import sys
import io
import os
sys.stdout = io.TextIOWrapper(sys.stdout.detach(), encoding='utf-8')
sys.stderr = io.TextIOWrapper(sys.stderr.detach(), encoding='utf-8')
base = "https://search.naver.com/search.naver?where=image&sm=tab_jum&query="
quote = rep.quote_plus("사자")
url = base + quote
res = req.urlopen(url)
savePath = "c:\\imagedown\\" # C:\imagedown\ 윈도우는 \대신 / 써도 상관x
try:
if not (os.path.isdir(savePath)):
os.makedirs(os.path.join(savePath))
except OSError as e:
if e.errno != errno.EEXIST:
print("폴더 만들기 실패")
raise
soup = BeautifulSoup(res, "html.parser")
img_list = soup.select("div.photo_bx api_ani_send._photoBox > div.thumb > a.link_thumb._imageBox._infoBox > img")
print("test", img_list)
답변 1
0
안녕하세요.
지금 현재 이미지를 따로 불러오는 방식으로 rendering이 변경되었습니다.
뒤에 배울 selenium으로 처리하실 수가 있으세요.
조만간 selenium 버전으로 변경해서 소스코드 올려드리겠습니다.
현재 예제에서 error 발생
0
365
3
유튜브 동영상 다운로드
0
1445
2
Atom 에디터 관련
0
337
1
위시켓 폼데이터
0
274
1
스케줄러 사용 관련 질문 드립니다
0
627
1
selenium 에러
0
427
1
Progress bar 쓰레드 관련
0
489
1
Install Package 관련 문의
0
328
1
tkinter 샘플 코드 실행 오류 건
0
1266
1
4-7-6 네이버 & 카카오 주식 정보 가져오기
0
380
1
네이버자동로그인_by_selenium
0
874
1
위시캣 로그인 처리 및 크롤링 질문
0
343
1
2-8-1 네이버이미지 크롤링 질문
1
604
3
li:nth-of-type 질문
0
350
2
에러가 뜨는데 잘 모르겠어요ㅠ
0
401
2
Install Packages 항목이 안보이는 이유가 뭘까요?
0
400
2
환경변수 Path 설정 방법
0
631
1
웹 브라우저 없는 스크랩핑 및 파싱 실습(1) - 인프런
0
332
1
웹 브라우저 없는 스크랩핑 및 파싱 실습(1) -git주소
0
472
3
download2-8-1. py질문
0
201
1
ip 차단 당하는 거 같은데 아무리 랜덤주고, sleep 줘도 안 되는데 다른 방법 더 있을까요??
0
639
1
인프런 환경이 바뀌어서 제나름대로 하는데
0
193
1
다시올려주신 예제파일로하는데
0
188
1
아직도 에러가뜨나보네요?
0
581
1





