473,287 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 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 4307
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Chris Lyon | last post by:
Could somebody please explain the difference between these two modules and explain why they are both required, and if there will ever be a unification of them?
2
by: Mike Zupan | last post by:
I had some problems with urllib and py2exe under pyton2.3. I works fine until i try to use the exe file. Here is the error Error: 1 LookupError Exception in Tk callback Function: <bound...
4
by: Monty | last post by:
Hello, Sorry for this maybe stupid newbie question but I didn't find any answer in all my readings about python: With urllib, using urlretrieve, it's possible to get the number of blocks...
8
by: Ritesh Raj Sarraf | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello Everybody, I've got a small problem with urlretrieve. Even passing a bad url to urlretrieve doesn't raise an exception. Or does it? If...
1
by: Timothy Smith | last post by:
ok what i am seeing is impossible. i DELETED the file from my webserver, uploaded the new one. when my app logs in it checks the file, if it's changed it downloads it. the impossible part, is that...
6
by: justsee | last post by:
Hi, I'm using Python 2.3 on Windows for the first time, and am doing something wrong in using urllib to retrieve images from urls embedded in a csv file. If I explicitly specify a url and image...
5
by: supercooper | last post by:
I am downloading images using the script below. Sometimes it will go for 10 mins, sometimes 2 hours before timing out with the following error: Traceback (most recent call last): File...
1
by: Abandoned | last post by:
Hi.. I want to set 30 second urllib.urlretrieve timeout.. Because if urllib.urlretrieve can't connect to page wait 1-2 hour... I download the images to my server with urlretrieve if you know the...
5
by: chrispoliquin | last post by:
Hi, I have a small Python script to fetch some pages from the internet. There are a lot of pages and I am looping through them and then downloading the page using urlretrieve() in the urllib...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.