Код: Выделить всё
from pprint import pprint
from bs4 import BeautifulSoup
import requests
html = requests.get ('https://search.naver.com/search.naver?where=nexearch&sm=top_hty&fbm=0&ie=utf8&query=%EB%82%A0%EC%94%A8')
## pprint(html.text)
soup = BeautifulSoup(html.text,'html.parser')
## pprint(soup)
data1 = soup.find('div',{'class':'report_card_wrap'})
data2 = data1.findAll('strong')
data3 = data1.findAll('span')
pprint(data2)
pprint(data3)
Код: Выделить всё
AttributeError: ResultSet object has no attribute 'text'. You're probably treating a list of elements like a single element. Did you call find_all() when you meant to call find()?
Я ожидаю получать только тексты, кроме тегов и классов.
Подробнее здесь: https://stackoverflow.com/questions/790 ... texts-only