当我运行这些代码时,我得到以下错误消息。在
"error:in parseres, skipped_tokens = self._parse(timestr, **kwargs)
TypeError: 'NoneType' object is not iterable"
这是我的密码
from datetime import datetime
from dateutil import parser
import datetime
import feedparser
content = {}
content2= {}
content3= {}
source = ("http://news.yahoo.com/rss/", "http://rss.cnn.com/rss/edition.rss" )
for i in source:
content = feedparser.parse(i)
for feed in content.entries:
content2[feed.title] = [feed.published]
content3 = [(item[0], parser.parse(item[1])) for item in content2]
print content3
错误:
^{pr2}$
看看当你运行一个稍微修改过的程序时会发生什么:
你会得到:
^{pr2}$查看
content2
中的第一个条目:相反,您可能希望:
这样可以得到:
或者你想把它记下来?在
相关问题 更多 >
编程相关推荐