471,119 Members | 1,303 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,119 software developers and data experts.

urllib.urlretrieve error

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
Jul 18 '05 #1
2 4213
"Sam Sungshik Kong" <ss*@chol.nospam.net> writes:
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
Jul 18 '05 #2
Thanks for the reply.

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

Thanks again.

Sam

"John J. Lee" <jj*@pobox.com> wrote in message
news:87************@pobox.com...
"Sam Sungshik Kong" <ss*@chol.nospam.net> writes:
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

Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Chris Lyon | last post: by
2 posts views Thread by Mike Zupan | last post: by
4 posts views Thread by Monty | last post: by
8 posts views Thread by Ritesh Raj Sarraf | last post: by
1 post views Thread by Timothy Smith | last post: by
6 posts views Thread by justsee | last post: by
5 posts views Thread by supercooper | last post: by
1 post views Thread by Abandoned | last post: by
5 posts views Thread by chrispoliquin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.