Skip to content

Commit

Permalink
deploy: 5943a6e
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-E-Rose committed Apr 22, 2024
1 parent 47d8f62 commit 7950dea
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions _modules/pubmed_parser/pubmed_web_parser.html
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,11 @@ <h1>Source code for pubmed_parser.pubmed_web_parser</h1><div class="highlight"><
<span class="k">else</span><span class="p">:</span>
<span class="n">keywords</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span>

<span class="n">doi</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span>
<span class="n">article_ids</span> <span class="o">=</span> <span class="n">tree</span><span class="o">.</span><span class="n">xpath</span><span class="p">(</span><span class="s2">&quot;//articleidlist//articleid&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">article_ids</span><span class="p">)</span> <span class="o">&gt;=</span> <span class="mi">1</span><span class="p">:</span>
<span class="k">for</span> <span class="n">article_id</span> <span class="ow">in</span> <span class="n">article_ids</span><span class="p">:</span>
<span class="k">if</span> <span class="n">article_id</span><span class="o">.</span><span class="n">attrib</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;idtype&quot;</span><span class="p">)</span> <span class="o">==</span> <span class="s2">&quot;doi&quot;</span><span class="p">:</span>
<span class="n">doi</span> <span class="o">=</span> <span class="n">article_id</span><span class="o">.</span><span class="n">text</span>
<span class="n">doi</span> <span class="o">=</span> <span class="n">tree</span><span class="o">.</span><span class="n">xpath</span><span class="p">(</span><span class="s1">&#39;//elocationid[@eidtype=&quot;doi&quot;]&#39;</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">doi</span> <span class="o">=</span> <span class="n">doi</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">text</span>
<span class="k">except</span> <span class="ne">IndexError</span><span class="p">:</span>
<span class="n">doi</span> <span class="o">=</span> <span class="kc">None</span>

<span class="n">language</span> <span class="o">=</span> <span class="n">tree</span><span class="o">.</span><span class="n">xpath</span><span class="p">(</span><span class="s2">&quot;//language&quot;</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
Expand Down

0 comments on commit 7950dea

Please sign in to comment.