Below is my code with the functions I have written, but I have a problem. When passing a string with the URL in the function get_feedparser('FEED_URL')
, since I do not parse it well when giving me the error:
{'encoding': 'utf-8', 'bozo': 1, 'feed': {}, 'version': '', 'namespaces': {}, 'entries': [], 'bozo_exception': SAXParseException ('syntax error',)}
Any ideas on how to fix this?
def get_feedparser(FEED_URL):
rss = feedparser.parse(FEED_URL)
return rss
infile = open('/home/pc/Desktop/Corpus/latin_URLs.txt', 'r')
for line in infile:
FEED_URL = line
fp = feedparser.parse(line)