Python Code: Github Link
import feedparser rss_url = 'http://feeds.macrumors.com/MacRumors-All' d = feedparser.parse(rss_url) type(d) for ent in d['entries']: print(ent) #feed된 key-value값 확인 ent #필요한 key값 확인 ent.keys() #필요한 key만 출력하기 for ent in d['entries']: id = ent['id'] title = ent['title'] author = ent['author'] published = ent['published'] print(published + ' | ' + title + ' | ' + author)
댓글 없음:
댓글 쓰기