Reputation: 11
I'm trying to find a way to download multiple web pages that looks like this: https://domain.index.aspx?place=&time=123
How can I download each page that ends with a three digit number?
I tried https://domain.index.aspx?place=&time=+[0-9]
and '\d{3}
but both do not work.
thanks
Upvotes: 1
Views: 293
Reputation: 27575
You must know the ending numbers of the different pages you want to download and do, for exemple:
for numb in ('458', '123', '453'):
sock = urllib.urlopen('https://domain.index.aspx?place=&time=' + numb)
or if you want to try all the numbers with 3 digits:
for numb in xrange(0,1000):
sock = urllib.urlopen('https://domain.index.aspx?place=&time=' + str(numb).zfill(3))
Upvotes: 1