Mastodon parser adjustment

This commit is contained in:
Mint 2022-09-03 14:47:55 +03:00
parent 7c906a9aae
commit 5613ee63a9

View file

@ -45,7 +45,8 @@ def get_mastodon_blocks(domain: str) -> dict:
if header_text in translations: if header_text in translations:
header_text = translations[header_text] header_text = translations[header_text]
if header_text in blocks: if header_text in blocks:
for line in header.find_next_siblings("table")[0].find_all("tr")[1:]: # replaced find_next_siblings with find_all_next to account for instances that e.g. hide lists in dropdown menu
for line in header.find_all_next("table")[0].find_all("tr")[1:]:
blocks[header_text].append( blocks[header_text].append(
{ {
"domain": line.find("span").text, "domain": line.find("span").text,