问题描述
我有一个问题,当从flickr.com下载图像时,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')
例如:
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.
现在,它失败了.我该怎么办? THX ~~~
Now it falied in downing the .gif! what should i do about this? THX~~~
任何建议都值得赞赏~~~
Any suggestion is appreciated~~~
推荐答案
我无法复制.
完全相同的代码下载了图片.
The exact same code downloaded the picture.
我正在使用python 2.7
I'm using python 2.7
它与服务器(当时)或您的Internet连接有关.
It has to do either with the server (at that time) or with your internet connection.
这篇关于如何通过Python urllib.urlretrieve()在flickr中下载图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!