Skip to content

Commit

Permalink
Fix incomplete abstract and title
Browse files Browse the repository at this point in the history
as well as multiple ids issues.
Closes gijswobben#23

In some cases the title and/or abstract obtained was incomplete.

Example: PMID 31689885
TItle tag:
<ArticleTitle>Gamma Irradiated <i>Rhodiola sachalinensis</i> Extract Ameliorates [...]</ArticleTitle>
Result was: 'Gamma Irradiated ' (now is 'Gamma Irradiate Rhodiola sachalinensis Extract[...]')
<AbstractText>The effect of <i>Rhodiola sachalinensis</i> Boriss extract irradiated [...]</ArticleTitle>
Result was: 'The effect of '

Also, this record returned a series of ids instead of just one.
  • Loading branch information
iacopy committed Mar 22, 2020
1 parent 5273166 commit fdf7b92
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pymed/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ def _getArticles(self: object, article_ids: list) -> list:
url="/entrez/eutils/efetch.fcgi", parameters=parameters, output="xml"
)

# Remove i tags to prevent text truncation
response = response.replace('<i>', '').replace('</i>')

# Parse as XML
root = xml.fromstring(response)

Expand Down

0 comments on commit fdf7b92

Please sign in to comment.