You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
383 B
Python
15 lines
383 B
Python
from urllib.request import urlopen
|
|
import markdown, html5lib
|
|
|
|
|
|
pad_url = "https://pad.xpub.nl/p/boring_old_tomato_sandwiches"
|
|
pad_text_url = pad_url + "/export/txt"
|
|
f = urlopen(pad_text_url)
|
|
pad_text = f.read().decode('utf-8')
|
|
# print (pad_text)
|
|
html = markdown.markdown(pad_text)
|
|
t = html5lib.parseFragment(html, namespaceHTMLElements=False)
|
|
print (t)
|
|
for elt in t:
|
|
print (elt)
|