urllib.urlretrieve error

S

Sam Sungshik Kong

Hello!

I'm trying to download PDF files from web to my computer using urllib.
Some pdf files are fine but other files are downloaded only 6kB which is
wrong.
It didn't show any error message.

I use urllib.urlretrieve(url, fn).

So I tried to download with Internet Explorer and it worked fine.

Anyone knows why?


My another question is how I can retrieve "mms:..." files.
urllib.urlretrieve doesn't work with that protocol.

Thanks.

Sam
 
J

John J. Lee

Sam Sungshik Kong said:
Hello!
Hello!

I'm trying to download PDF files from web to my computer using urllib.
Some pdf files are fine but other files are downloaded only 6kB which is
wrong.
It didn't show any error message.

I use urllib.urlretrieve(url, fn).

So I tried to download with Internet Explorer and it worked fine.

Anyone knows why?

What was the content of the 6kb file? Don't assume it was the first
6kb of the PDF file: for instance, it may be an HTML page.

My another question is how I can retrieve "mms:..." files.
urllib.urlretrieve doesn't work with that protocol.

IIRC, that's a proprietary Microsoft scheme that's designed for
'streaming' (ie. downloading and playing back the contents at the same
time). I think there's a dodgy C program around somewhere which is
just about able to grab them, but I don't know of a Python-accessible
implementation.


John
 
S

Sam Sungshik Kong

Thanks for the reply.

The problem was that url was wrong.
It's not the library's fault...:)

Thanks again.

Sam
 

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,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top