I want to know how to find all images in main tag if main tag exist ? except just find images that's in out of tag (I want to make an order to scrape images in main tag if exist and if there is no main tag scrape all images)
In fact I want to fillter header and footer tag and scrape all images in between.
if find('main'): for link in soup.find('main').find_all('img'): grabbedImages = link.get('src')else: for link in soup.find_all('img'): grabbedImages = link.get('src')
Thank you in advance for your guidance.