Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot import CustomGoogleScholarTopPublicationCitations #13

Closed
rohanjha123 opened this issue May 17, 2023 · 3 comments
Closed

Cannot import CustomGoogleScholarTopPublicationCitations #13

rohanjha123 opened this issue May 17, 2023 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@rohanjha123
Copy link

I'm currently using a macOS Big Sur, python 3.11.1. While I can import CustomGoogleScholarOrganic without issues, I am unable to import CustomGoogleScholarTopPublicationCitations, with the relevant error message included below.

>>> from google_scholar_py import CustomGoogleScholarTopPublicationCitations
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'CustomGoogleScholarTopPublicationCitations' from 'google_scholar_py' (/Users/rohanjha/.pyenv/versions/3.11.1/lib/python3.11/site-packages/google_scholar_py/__init__.py)
>>> from google_scholar_py import CustomGoogleScholarOrganic
>>> 

Any help on this would be greatly appreciated! Additionally, example_usage.py says that documentation exists for each of these functions. Could you please point me to the documentation if possible? I'm interested in scraping the citation counts for various papers, and would love to read up on the best way I can do so. Thanks for your support!

@github-actions
Copy link

Potential duplicates:

@rohanjha123
Copy link
Author

Hi, I'd read the thread linked above but I don't believe this is a duplicate because I'm using Python 3.11 and can only not import 1 package (while importing the other 2 works fine)

@dimitryzub dimitryzub added help wanted Extra attention is needed and removed potential-duplicate labels May 29, 2023
@dimitryzub
Copy link
Owner

dimitryzub commented May 29, 2023

@rohanjha123 I apologize, it was a typo by me. There's no CustomGoogleScholarTopPublicationCitations class. I've updated example_usage.py

Class naming is confusing. This is something I'll update in the future.

Correct code example:

from google_scholar_py import CustomGoogleScholarTopPublicationArticle
import json

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
)

print(json.dumps(top_publication_citation, indent=2, ensure_ascii=False))
- from google_scholar_py import CustomGoogleScholarTopPublicationCitations
+ from google_scholar_py import CustomGoogleScholarTopPublicationArticle

Let me know if this works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants