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:
parent
dada8514e4
commit
bd2b064153
1 changed files with 3 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue