ElsevierDev / elsapy

A Python module for use with Elsevier's APIs: Scopus, ScienceDirect, others.
http://api.elsevier.com
BSD 3-Clause "New" or "Revised" License
367 stars 144 forks source link

readDocs #20

Closed ghost closed 5 years ago

ghost commented 6 years ago

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.")

m-direnzo commented 6 years ago

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

ghost commented 6 years ago

Thanks a lot! I will look into this.

Thanks a lot!

Regards, Finn Potason http://potason.github.io (Shuai Wang)

Office T357, KR&R @ VU Amsterdam Whatsapp: +31 6 52691901

Google Scholar https://scholar.google.fr/citations?hl=fr&inst=4393003693960974403&oi=ao&user=chqjd5QAAAAJ Scopus https://www-scopus-com.vu-nl.idm.oclc.org/freelookup/form/author.uri Author ID: 56923985200 ORCID: orcid.org/0000-0002-1261-9930

On Mon, Feb 12, 2018 at 7:19 PM, m-direnzo notifications@github.com wrote:

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) else: print("Read document failed.")

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

I hope that helps!

Best regards, Matthew DiRenzo

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ElsevierDev/elsapy/issues/20#issuecomment-365012924, or mute the thread https://github.com/notifications/unsubscribe-auth/Ac0Z6SVemmQu1-eG6WQ3T5Lh1eLAZvnrks5tUICggaJpZM4RwwWz .