강의

멘토링

커뮤니티

Inflearn Community Q&A

daminking1236981's profile image
daminking1236981

asked

Python Recipes - Introduction to Web Utilization (including eBook)

[Web Crawling] 2. find function

find값이 None값이 나오는데 해결이 안 되네요..ㅠ

Written on

·

1K

0

from bs4 import BeautifulSoup as bs
from pprint import pprint
import requests

html = requests.get('https://search.naver.com/search.naver?query=날씨')
# pprint(html.text)

soup = bs(html.text,'html.parser')

data1 = soup.find('div',{'class':'detail_box'})
pprint(data1)

코드 값은 이렇게 쳤는데 아무리 찾아보고 div, class 값 바꿔봐도 값이 안 나옵니다..
python

Answer 1

0

soorte2140795님의 프로필 이미지
soorte2140795
Instructor

None이 나왔다는 것은 제대로 element를 추출하지 못했다는 것을 의미합니다. 

강의에 나온 시점과 다를 수 있으니, 직접 element의 태그와 클래스를 구해보세요 :)

daminking1236981's profile image
daminking1236981

asked

Ask a question