fedi dev is fun!!!

This commit is contained in:
Lynne Megido 2020-03-18 15:09:04 +10:00
parent dada8514e4
commit bd2b064153
Signed by: lynnesbian
GPG Key ID: F0A184B5213D9F90

View File

@ -25,7 +25,9 @@ def extract_post(post):
ht.unwrap()
for link in soup.select("a"): #ocnvert <a href='https://example.com>example.com</a> to just https://example.com
link.insert_after(link["href"])
if 'href' in link:
# apparently not all a tags have a href, which is understandable if you're doing normal web stuff, but on a social media platform??
link.insert_after(link["href"])
link.decompose()
text = soup.get_text()