Hi everyone,
I'm trying to run an example from the Biopython cookbook and it returns an error. I'm wondering if anything serious has changed in the PubMed API recently...
from Bio import Medline
handle = Entrez.esearch(db="pubmed", term="orchid", retmax=463)
record = Entrez.read(handle)
idlist = record["IdList"]
handle = Entrez.efetch(db="pubmed", id=idlist, rettype="medline", retmode="text")
I'm getting:
HTTPError Traceback (most recent call last)
<ipython console> in <module>()
python-2.7.1-shared/lib/python2.7/site-packages/biopython-1.58-py2.7-linux-x86_64.egg/Bio/Entrez/__init__.pyc in efetch(db, **keywds)
111 variables = {'db' : db}
112 variables.update(keywds)
--> 113 return _open(cgi, variables)
114
115 def esearch(db, term, **keywds):
python-2.7.1-shared/lib/python2.7/site-packages/biopython-1.58-py2.7-linux-x86_64.egg/Bio/Entrez/__init__.pyc in _open(cgi, params, post)
358 handle = urllib2.urlopen(cgi)
359 except urllib2.HTTPError, exception:
--> 360 raise exception
361
362 return handle
HTTPError: HTTP Error 500: Internal server error
I checked and idlist
is, as expected, a list of PubMed IDs as strings, so Entrez.esearch seems to be working.
['22499266', '22496851', '22483052', '22418255', '22415688', '22408409', '22397405', '22391855', '22375900', '22367365', ...]
Would appreciate your help!
Bravo, maestro! ",".join(idlist) has solved the problem. Many thanks!