samedi 10 avril 2021

Python Image scraping from webpage: Only single image is loading

i am scraping images from a webpage using Beautiful Soup. I get the list of all tags but it is returning only one image because it scrapes only one tag. here is the code :

def gethtml(url): 
  r = requests.get(url) 
  return r.text 
htmldata = gethtml(u) 
soup = BeautifulSoup(htmldata, 'html.parser') 
for item in soup.find_all('img'):
  print(item['src'])

How to get src of all the images on a webpage?




Aucun commentaire:

Enregistrer un commentaire