ranahaani / GNews

A Happy and lightweight Python Package that Provides an API to search for articles on Google News and returns a JSON response.
https://pypi.org/project/gnews/
MIT License
708 stars 106 forks source link

GNews.get_news_by_site(site) not working #99

Open AnaBucchi opened 2 months ago

AnaBucchi commented 2 months ago

I'm trying to use Gnews to find news about AI in a particular media, but I get an error when I use the function.

from gnews import GNews

GNews.get_news_by_site("cnn.com")

I got this error: AttributeError: type object 'GNews' has no attribute 'get_news_by_site'

I fell I'm missing something, please help

juraj-jursa commented 2 months ago

You first want to instantiate an object of Class GNews as follows:

from gnews import GNews

google_news = GNews()
f = google_news.get_news_by_site('cnn.com')