Skip to content

Commit 9dd965d

Browse files
authored
Merge pull request #619 from flairNLP/fix-bug-in-get-value-by-path
Fix bug in author parsing in `TheNamibian`
2 parents acd378f + 1c263f1 commit 9dd965d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/fundus/publishers/na/the_namibian.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ class V1(BaseParser):
2121
VALID_UNTIL = datetime(year=2024, month=1, day=31).date()
2222
_summary_selector = XPath("//div[contains(@class, 'tdb-block-inner')]/p[position()=1]")
2323
_paragraph_selector = XPath("//div[contains(@class, 'tdb-block-inner')]/p[position()>1]")
24+
2425
_title_substitution_pattern: Pattern[str] = re.compile(r" - The Namibian$")
26+
_author_selector = XPath("//Person/name")
2527

2628
@attribute
2729
def body(self) -> ArticleBody:
@@ -44,7 +46,7 @@ def title(self) -> Optional[str]:
4446

4547
@attribute
4648
def authors(self) -> List[str]:
47-
return generic_author_parsing(self.precomputed.ld.get_value_by_key_path(["Person", "name"]))
49+
return generic_author_parsing(self.precomputed.ld.xpath_search(self._author_selector))
4850

4951
class V1_1(V1):
5052
VALID_UNTIL = datetime.today().date()

0 commit comments

Comments
 (0)