使用Biopython Bio Entrez pars解析PubMed中心XML

2024-03-29 12:04:28 发布

您现在位置:Python中文网/ 问答频道 /正文

我尝试使用Biopython的bioentrez解析函数解析PubMed中心XML文件。到目前为止,我一直在努力:

from Bio import Entrez
for xmlfile in glob.glob ('samplepmcxml.xml'):
   print xmlfile
   fh = open (xmlfile, "r")
   read_xml (fh, outfp)
   fh.close()

def read_xml (handle, outh):
   records = Entrez.parse(handle)
   for record in records:
      print record

我得到以下错误:

^{pr2}$

我已经下载了建筑文章.dtd文件。是否需要安装其他DTD文件来描述PMC文件的模式?有人成功地使用Bio Entrez函数或其他方法来解析PMC文章吗?在

谢谢你的帮助!在


Tags: 文件函数inforreadentrezxmlrecord