views:

64

answers:

1

the pages have only one variable which changes, and each page only holds one image.

(example: http://www.example.com/photos/ooo1.jpg ...http://www.example.com/photos/1745.jpg)

I'm currently building the script with python and beautfulSoup but am having a problem creating a loop with the changing variable. I just getting started with python, so thanks for the help.

+1  A: 
for i in xrange(1, 1746):
    file = urllib2.urlopen("http://www.example.com/photos/%04d.jpg" % i)
    ...
    # Write file locally
    ...

You don't need Beautiful soup if you already know the image urls.

Eric Fortin
found a post on http://www.techniqal.com/blog/2008/07/31/python-file-read-write-with-urllib2/ detailing the exact process I was looking for. Thanks for the help
Justjoe