1
0
Fork 0
mirror of https://github.com/Lynnesbian/FediBooks/ synced 2024-12-26 22:38:58 +00:00

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()