Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Commit ced77e5

Browse files
committed
Fix article ID parsing issue
This fix avoids returning also the IDs of cited papers (they are within the ReferenceList element of the xml). Fixes #22 An alternative XPath to be used: path = ".//PubmedData/ArticleIdList/ArticleId[@idtype='pubmed']"
1 parent f2f79de commit ced77e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pymed/article.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __init__(
4747
self.__setattr__(field, kwargs.get(field, None))
4848

4949
def _extractPubMedId(self: object, xml_element: TypeVar("Element")) -> str:
50-
path = ".//ArticleId[@IdType='pubmed']"
50+
path = "MedlineCitation/PMID"
5151
return getContent(element=xml_element, path=path)
5252

5353
def _extractTitle(self: object, xml_element: TypeVar("Element")) -> str:

0 commit comments

Comments
 (0)