How to batch download files from web page?

S

sj

I wish to download hundreds of files from the University of Iowa sound
archive. Doing it manually would be a daunting task especially since the
files are each a few mega bytes long. Is there a standard way of using
Python for such a task? I have a fair amount of programming experiance but
very little of it relates to networks.

For those who are intrested the University of Iowa's sound archive may be
found at http://theremin.music.uiowa.edu/MIS.html

Thanks in advance
Steven Jones
 
P

Paul Rubin

sj said:
I wish to download hundreds of files from the University of Iowa sound
archive. Doing it manually would be a daunting task especially since the
files are each a few mega bytes long. Is there a standard way of using
Python for such a task? I have a fair amount of programming experiance but
very little of it relates to networks.

You could use the urllib module, or maybe you could use wget:

http://www.gnu.org/software/wget/wget.html
 
M

Michael Geary

I wish to download hundreds of files from the University of Iowa
sound archive. Doing it manually would be a daunting task
especially since the files are each a few mega bytes long. Is there
a standard way of using Python for such a task? I have a fair
amount of programming experiance but very little of it relates
to networks.

For those who are intrested the University of Iowa's sound archive
may be found at http://theremin.music.uiowa.edu/MIS.html

The easiest way to download the individual files is with
urllib.urlretrieve().

You can parse the HTML files using either htmllib.HTMLParser or the
HTMLParser module, combined with urllib.urlopen().

If you do this Google search:

urlopen htmlparser

The first several matches have some nice code samples showing how to find
the links in a web page. Add urlretrieve() to download the files and you'll
be off and running.

-Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top