我正在编写一个Python脚本(从here修改并在下面报告)在publibmed上搜索某所大学的论文数量,并下载合作者的从属关系。如果我运行代码,而不是我得到的从属关系。你知道怎么做吗?我该怎么做才能下载所有作者的从属关系呢?谢谢!在import urllib, urllib2, sys
import xml.etree.ElementTree as ET
def chunker(seq, size):
return (seq[pos:pos + size] for pos in xrange(0, len(seq), size))
query = '(("University of Copenhagen"[Affiliation]))# AND ("1920"[Publication Date] : "1930"[Publication Date]))'
esearch = 'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&mindate=2001&maxdate=2010&retmode=xml&retmax=10000000&term=%s' % (query)
handle = urllib.urlopen(esearch)
data = handle.read()
root = ET.fromstring(data)
ids = [x.text for x in root.findall("IdList/Id")]
print 'Got %d articles' % (len(ids))