importhttp
fromBioimportEntrez, Medline
Entrez.email ='foobar@example.org'
handle = Entrez.esearch(db='pubmed',term='"Meta-Analysis" [Publication Type]',rettype='count')
record = Entrez.read(handle)
count = record['Count']
print(count)
handle = Entrez.esearch(db='pubmed',term='"Meta-Analysis" [Publication Type]',retmax=count,usehistory='y')
record = Entrez.read(handle)
webenv = record['WebEnv']
query_key = record['QueryKey']
foriinrange(,int(count),10000):
try:
handle = Entrez.efetch(db='pubmed',rettype='medline',retmode='text',webenv=webenv,query_key=query_key,retmax=10000,retstart=i)
forrecordinMedline.parse(handle):
withopen('meta.txt','a')asf:
print(record['JT'],end='\n',file=f)
excepthttp.client.IncompleteReadasexception:
print('%s'% exception)
领取专属 10元无门槛券
私享最新 技术干货