Skip to main content


Python Webscraping (convert index page Images to html webpage)

View the video for demo


This will scrap images and convert the data into html page using html image tags


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Web scraping index page and converting image url to html thumbnail webpage
# Create by Joel Dcosta
# Check out my other web scraping videos uploaded previously
# ##########################################################################
import requests
import re

url="<Enter INDEX PAGE URL>"

f = open("py3 Scrap image.htm", "a+")

website = requests.get(url)
html = website.text

#jpg
files = re.findall('href="(.*jpg)"', html)

#print sorted(x for x in (files))
for infile in sorted(x for x in (files)):
   #using html image tags <img src="IMAGE_URL" width='200' height='133
   f.write("<img src='")
   f.write(url + infile)
   f.write("' width='200' height='133'>")

f.close()



🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍

Popular Posts





Subscribe to our Channel


Follow us on Facebook Page

Join our python facebook groups



Join us on Telegram