我正在使用guv
并feedparser
同时解析多个提要。以下是我的代码:
guv.monkey_patch(time=True, socket=True)
def parse_feed(_feed):
return feedparser.parse(_feed)
def main():
urls = ["http://feeds.bbci.co.uk/news/rss.xml"]
pool = guv.GreenPool()
results = pool.starmap(parse_feed, zip(urls))
for resp in results:
print(str(resp))
但是,我得到以下输出:
{'bozo_exception': TypeError('a float is required',), 'bozo': 1, 'feed': {}, 'entries': []}
我在使用时遇到了类似的问题Eventlet
,但在本机 Python 3threading
库中没有。