ElsevierDev/elsapy

readDocs

Closed this issue · 2 comments

I would like to retrieve the documents as you showed in the example python script. However, I always fail. Could you please let me know how I can get access to all the documents of an author? I only need the DOI for further analysis of citation, etc. Thanks

Scopus (Abtract) document example

Initialize document with ID as integer

scp_doc = AbsDoc(scp_id = 56923985200)
if scp_doc.read(client):
print ("scp_doc.title: ", scp_doc.title)
scp_doc.write()
else:
print ("Read document failed.")

ScienceDirect (full-text) document example using PII

pii_doc = FullDoc(sd_pii = 'S1674927814000082')
if pii_doc.read(client):
print ("pii_doc.title: ", pii_doc.title)
pii_doc.write()
else:
print ("Read document failed.")

ScienceDirect (full-text) document example using DOI

doi_doc = FullDoc(doi = '10.1016/S1525-1578(10)60571-5')
if doi_doc.read(client):
print ("doi_doc.title: ", doi_doc.title)
doi_doc.write()
else:
print ("Read document failed.")

Hello,

In your first example, the Scopus ID you provided does not appear to be valid.

In the second and third examples, both the PII and DOI return the expected results with a standard API key obtained from dev.elsevier.com. Please verify that you've properly set up your config.json file with a valid API key and initialized the ElsClient object with that configuration per the example.

Lastly, I'm not sure if the lack of indentation in your code is a product of copy/pasting to this site. If not, please be aware that the conditional statements you wrote will not be correctly interpreted if you do not indent the subsequent statements in the block, e.g.

if doi_doc.read(client):
    print("doi_doc.title: ", doi_doc.title)
    doi_doc.write()
else:
    print("Read document failed.")

will be interpreted correctly whereas the code you pasted will not.

I hope that helps!

Best regards,
Matthew DiRenzo