Answer the question
In order to leave comments, you need to log in
How to extract text from a tag using BeautifulSoup?
In 'price' writes 'NoneType' object has no attribute 'text'.
for item in items:
cards.append(
{
'title': item.find('div', class_='h3').find('a').get_text(strip=True),
<b>'price': item.find('span', class_='g-price-summ-cur').text(strip=True),</b>
'link_product': item.find('div', class_='h3').find('a').get('href')
}
)
return cards
for item in items:
writer.writerow([item['title'], <b>item['price'].text</b>, item['link_product']])
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question