pythonurllibflickr

How to download a image in flickr by Python urllib.urlretrieve()?


I have a problem that when dowloading a image from flickr.com,the python function urllib.urlretrieve() always return an error

[Errno socket error] (10060, 'Operation timed out')

for example:

import urllib

url = "http://farm3.static.flickr.com/2659/4207030547_23e6000d29_o.gif"
urllib.urlretrieve(url,"C://tmp.gif")

I am Chinese,and I dont know if the "time out" has anything to do with the speed of the the internet in China.

Now it falied in downing the .gif! what should i do about this? THX~~~

Any suggestion is appreciated~~~


Solution

  • I can't reproduce.

    The exact same code downloaded the picture.

    I'm using python 2.7

    It has to do either with the server (at that time) or with your internet connection.

    enter image description here