python extract images into an array from a url

this should extract all images from a url into an array using python


from bs4 import BeautifulSoup
from urllib.request import urlopen
url = ""
page = urlopen(url)
html ="utf-8")
soup = BeautifulSoup(html, "html.parser")
images = soup.find_all("img")

return result

[<img src=""/>, <img src=""/>]

extract the 1st image src only rather than the full img tag

add this instead of print(images)


images_src = images[0]["src"];

No Items Found.

Add Comment
Type in a Nick Name here
Page Views

This page has been viewed 167 times.

Search Code
Search Code by entering your search text above.

This is my test area for webdev. I keep a collection of code snippits here, mostly for my reference. Also if i find a good site, i usually add it here.


Random Quote
You drown not by falling in the river, but by staying submerged.