#! /usr/bin/python3 """ A script to generate html from the rss feed """ import xml.etree.ElementTree as et def main(): tree = et.parse("feed.xml") root = tree.getroot() channel = root[0] template = "" # Open html template with open("template.html", "r") as fp: template = fp.read() # Get articles from rss for item in channel.findall("item"): article = item.find("description").text # Remove article tags. article = article[article.find("
")+9::] article = article[:article.find("
"):] print(article) if __name__ == "__main__": main()