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.
22 lines
528 B
Python
22 lines
528 B
Python
import os, requests, urllib
|
|
from markdown import markdown
|
|
from bs4 import BeautifulSoup
|
|
|
|
url = "https://pad.xpub.nl/p/jargon-file.test/export/txt"
|
|
data = urllib.request.urlopen(url).read() #bytes object
|
|
string = data.decode()
|
|
# print(string)
|
|
|
|
html = markdown(string)
|
|
# print(html)
|
|
|
|
soup = BeautifulSoup(html)
|
|
headers = soup.find_all('h1')
|
|
# print(headers)
|
|
|
|
cmd = '#network'
|
|
query = cmd.replace('#','')
|
|
for header in soup('h1'):
|
|
if query in header.string:
|
|
print(header.string)
|
|
print('---') |