pip install beautifulsoup4
from bs4 import BeautifulSoup
with open("index.html", "r") as f:
contents = f.read()
soup = BeautifulSoup(contents, 'lxml')
for tag in soup.find_all("img"):
print("{0}: {1}".format(tag.name, tag.text))