ckreibich / scholar.py

A parser for Google Scholar, written in Python
2.11k stars 777 forks source link

Citation number #123

Open mrkevinyuan opened 5 years ago

mrkevinyuan commented 5 years ago

Hi

I am currently working on a project on citation prediction of articles and using the shcolar.py package. I am wondering do you have any command line parameter that comes out of the code and can only give me the result of each article's citation number?(just the counting nunber, eg. 200)

Thanks Kevin Yuan

Misty-2409 commented 3 years ago

following works for me. Just merged #50 and #128

`import scholar

author = "Julita Vassileva" title = "Trust and reputation model in peer-to-peer networks"

art = ["-c", "1", "--author", author, "--phrase", title ]

querier = scholar.ScholarQuerier() settings = scholar.ScholarSettings() settings.set_citation_format(4) querier.apply_settings(settings)

Take in search phrase and return BibTex of first article found

def searchScholar(searchphrase): query = scholar.SearchScholarQuery() query.set_words(searchphrase) querier.send_query(query) articles = querier.articles return articles[0].attrs['num_citations'][0]

print("number of citation = ",searchScholar(art))`