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
743 stars 106 forks source link

GNews.get_news_by_site(site) not working #99

Open AnaBucchi opened 5 months ago

AnaBucchi commented 5 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 5 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')