How to fix HTTP Error 404 in python when trying to connect to OAI provider using pyoai

87 Views Asked by At

I'm trying to connect me with a OAI provider using pyoai but i'm getting this error

i'm using python3.7 on windows 10

This is my code, is just simple following the official pyoai documentation https://pypi.org/project/pyoai/

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)

I'm getting HTTPError

  File "C:\..\lib\urllib\request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

I thought the problem was for use python3.7 but i've already changed to 3.6 and i had the same problem

1

There are 1 best solutions below

0
On

I think the problem was with the data provider, i used other data providers and i haven't that error:

URL = 'http://revista-iberoamericana.pitt.edu/ojs/index.php/Iberoamericana/oai'

Actually there's a list of registered oai 2.0 providers here: Registered Data providers