How to read multiple url files at one go in python?

python

#1

Hello,
I have to write a code in python to read multiple url files in a folder.How can I do it.
Thnx in advance for the help.


#2

Hello,

You can try it out his way, hope it works.

import urllib2
i=0
j=1990
while j<2009:
response = urllib2.urlopen(‘file:///D:/USER%20ACCOUNT/Desktop/google-python-exercises/babynames/baby’+str(j)+’.html’)
print response.info()
html = response.read()

string[i] = re.findall(r'<td>(\d+)</td><td>(\w+)</td><td>(\w+)</td>',html)
print string[i]
j =j+2
i=i+1