본문 바로가기

info

파이썬으로 RSS 피드 읽어오기

import feedparser


urls = (

    "http://bomsoft.com/rss",

    "http://abc.com/rss"

)


def crawl_rss (url) :

    d = feedparser.parse(url)

    print( type(d))

    print( d.feed["title"] )

    for e in d.entries :

        print ("title = " + e.title)

        print ("link = " + e.link)

        print ("description = " + e.description)

        print ("pubDate = " + str(e.published) )


if __name__ == "__main__" :

    for url in urls:

        crawl_rss(url)