Retrieve url's of all jpegs at a web page URL

grimmus graham.colmer at gmail.com
Tue Sep 15 16:28:08 CEST 2009


Hi,

I would like to achieve something like Facebook has when you post a
link. It shows images located at the URL you entered so you can choose
what one to display as a summary.

I was thinking i could loop through the html of a page with a regex
and store all the jpeg url's in an array. Then, i could open the
images one by one and save them as thumbnails with something like
below.

Can anyone provide some advice on how best to achieve this ?

Sorry for the noob questions and syntax !!

from PIL import Image
import urllib

image_uri = 'http://www.gstatic.com/news/img/bluelogo/en_ie/news.gif'
PILInfo = Image.open(urllib.urlretrieve(image_uri)[0])
PILInfo.save("saved-image.gif");



More information about the Python-list mailing list