我試圖使用元數據採集包https://pypi.python.org/pypi/pyoai收穫本網站https://www.duo.uio.no/oai/request?verb=Identify元數據收集
我試圖在pyaoi網站的例子中的數據,但沒有奏效。當我測試它時,我得到一個錯誤。該代碼是:
from oaipmh.client import Client
from oaipmh.metadata import MetadataRegistry, oai_dc_reader
URL = 'http://uni.edu/ir/oaipmh'
registry = MetadataRegistry()
registry.registerReader('oai_dc', oai_dc_reader)
client = Client(URL, registry)
for record in client.listRecords(metadataPrefix='oai_dc'):
print record
這是堆棧跟蹤:
Traceback (most recent call last):
File "/Users/arashsaidi/PycharmProjects/get-new-DUO/get-files.py", line 8, in <module>
for record in client.listRecords(metadataPrefix='oai_dc'):
File "/Users/arashsaidi/.virtualenvs/lbk/lib/python2.7/site-packages/oaipmh/common.py", line 115, in method
return obj(self, **kw)
File "/Users/arashsaidi/.virtualenvs/lbk/lib/python2.7/site-packages/oaipmh/common.py", line 110, in __call__
return bound_self.handleVerb(self._verb, kw)
File "/Users/arashsaidi/.virtualenvs/lbk/lib/python2.7/site-packages/oaipmh/client.py", line 65, in handleVerb
kw, self.makeRequestErrorHandling(verb=verb, **kw))
File "/Users/arashsaidi/.virtualenvs/lbk/lib/python2.7/site-packages/oaipmh/client.py", line 273, in makeRequestErrorHandling
raise error.XMLSyntaxError(kw)
oaipmh.error.XMLSyntaxError: {'verb': 'ListRecords', 'metadataPrefix': 'oai_dc'}
我需要訪問我已鏈接到上面的頁面上的所有文件以及生成一些元數據的附加文件。
有什麼建議嗎?