urllib.urlretrieve error

John J. Lee jjl at pobox.com
Mon May 24 15:20:25 EDT 2004


"Sam Sungshik Kong" <ssk at 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



More information about the Python-list mailing list