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

google_news.country not working #98

Open
AnaBucchi opened this issue Jun 19, 2024 · 0 comments
Open

google_news.country not working #98

AnaBucchi opened this issue Jun 19, 2024 · 0 comments

Comments

@AnaBucchi
Copy link

I have been using the Python Gnews package to access news about AI. I would like these news to be only from media of a specific country (Chile). However, I am not getting the google_news.country function that in this package should select only news from a specific country. Instead, it gives me news from many different countries.

This is the code I have:

from gnews import GNews
import datetime

noticias = []
for mes in range(1,3):
    start = datetime.date(2019, mes, 1)
    end = datetime.date(2019, mes, 5) 
    country = 'Chile'
    google_news = GNews(language='es', start_date=start, end_date=end, country = country)
    rsp = google_news.get_news("IA|Inteligencia Artificial")
    if rsp is [None]:
        pass
    else:
        noticias.append(rsp) 

This problem also occurs when country = 'CL'.

would appreciate advice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant