-
Notifications
You must be signed in to change notification settings - Fork 17
/
example_usage.py
33 lines (27 loc) · 1.28 KB
/
example_usage.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# each function have documentation with an example "usage" script, after function arugments
from google_scholar_py import CustomGoogleScholarOrganic
from google_scholar_py import SerpApiGoogleScholarOrganic
from google_scholar_py import CustomGoogleScholarTopPublicationArticle
import json
# TODO: add more examples
custom_parser_get_organic_results = CustomGoogleScholarOrganic().scrape_google_scholar_organic_results(
query='blizzard',
pagination=False,
save_to_csv=False,
save_to_json=False
)
top_publication_citation = CustomGoogleScholarTopPublicationArticle().scrape_google_scholar_top_publication_articles(
journal_publications_link='https://scholar.google.com/citations?hl=en&vq=en&view_op=list_hcore&venue=TdhLrHqKTh8J.2022',
pagination=True,
save_to_csv=False,
save_to_json=False
)
serpapi_parser_get_organic_results = SerpApiGoogleScholarOrganic().scrape_google_scholar_organic_results(
query='blizzard',
api_key='your-serpapi-api-key', # https://serpapi.com/manage-api-key
lang='en',
pagination=False,
)
print(json.dumps(custom_parser_get_organic_results, indent=2, ensure_ascii=False))
print(json.dumps(serpapi_parser_get_organic_results, indent=2, ensure_ascii=False))
print(json.dumps(top_publication_citation, indent=2, ensure_ascii=False))