Python: parser code does not work

By JosephKirby on Apr 01, 2021

It works if the title is displayed and the price, and if I add a picture, it displays an empty list

re = requests.get('link')
html = re.text
soups = ba(html, 'lxml')
aa = [(title.string, price.string, images['src']) for title in soups.section.find_all('h3') 
for price in title.find_parents()[0].find('p', class_='price_color')
for images in title.find_parents()[0].find('img')]
print(aa)

Comments

Sign in to comment.
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.