Skip to content

Instantly share code, notes, and snippets.

@TheNorthEestern
Created June 16, 2020 00:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheNorthEestern/7b33c4391edcde4d2e9cb6e954052474 to your computer and use it in GitHub Desktop.
Save TheNorthEestern/7b33c4391edcde4d2e9cb6e954052474 to your computer and use it in GitHub Desktop.
import requests
from pprint import pprint
import xml.etree.ElementTree as ET
session = requests.Session()
session.headers.update({'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0'})
r = session.get("https://www.reddit.com/r/NHKEasyNews/.rss")
root = ET.fromstring(r.text)
print(root.tag)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment