from lxml import etree import urllib.request import os from argparse import ArgumentParser from datetime import datetime parser = ArgumentParser() parser.add_argument("url", type=str) parser.add_argument("output", type=str) args = parser.parse_args() HEADER = """ RSS Feed """ URL = args.url DIR = args.output if not os.path.exists(DIR): os.makedirs(DIR) os.makedirs(os.path.join(DIR, "articles"), exist_ok=True) FILE = open(os.path.join(DIR, "index.html"), "w") print(HEADER, file=FILE) print("

RSS Feed

", file=FILE) print(f"

Bijgewerkt: {datetime.now().strftime('%d-%m-%Y %H:%M uur')}", file=FILE) print("

", file=FILE) print("", file=FILE) print("", file=FILE) FILE.close()