Skip to content

Commit

Permalink
fix for ... More in original_text
Browse files Browse the repository at this point in the history
  • Loading branch information
neon-ninja committed Feb 15, 2022
1 parent 508626e commit 527eaba
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions facebook_scraper/extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,13 @@ def extract_text(self) -> PartialPost:
original_text = None
hidden_div = element.find('div[style="display:none"]', first=True)
if hidden_div:
original_text = paragraph_separator.join(
node.text for node in hidden_div.find("p,span[role=presentation]")
)
original_text = []
for node in hidden_div.find("p,span[role=presentation]"):
node = utils.make_html_element(
html=node.html.replace('>… <', '><', 1).replace('>More<', '', 1)
)
original_text.append(node.text)
original_text = paragraph_separator.join(original_text)

return {
'text': text,
Expand Down

0 comments on commit 527eaba

Please sign in to comment.