By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,206 Members | 1,035 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,206 IT Pros & Developers. It's quick & easy.

urllib.urlretrieve error

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
"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

P: n/a
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.