Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix itemprop containing articleBody
If itemprop is not exactly == "articleBody" the node was "cleaned"

for instance itemprop="description articleBody" would be cleaned. 
Blogspot / Blogger for instance uses this itemprop
  • Loading branch information
AndyTheFactory authored Oct 4, 2022
commit aebd9c26aea1224c2f292cc6e70dfac52af1265f
2 changes: 1 addition & 1 deletion newspaper/cleaners.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(self, config):
.create("\n", "\n\n")\
.append("\t")\
.append("^\\s+$")
self.contains_article = './/article|.//*[@id="article"]|.//*[@itemprop="articleBody"]'
self.contains_article = './/article|.//*[@id="article"]|.//*[contains(@itemprop,"articleBody")]'

def clean(self, doc_to_clean):
"""Remove chunks of the DOM as specified
Expand Down