可是feedparser并没有提供这个功能,只好采用其他方法了,具体办法请参看feedparser项目的issue221。
其实也很简单,按照上面文档的说明
developers have had the ability to set a global timeout for over seven years by importing the socket library and setting the timeout in this way:
代码如下:
import socket
socket.setdefaulttimeout( )
查看更多关于Python中为feedparser设置超时时间避免堵塞的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did91164