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

Datetime not available #146

Open
felipefreitasbr opened this issue Apr 1, 2024 · 4 comments
Open

Datetime not available #146

felipefreitasbr opened this issue Apr 1, 2024 · 4 comments

Comments

@felipefreitasbr
Copy link

felipefreitasbr commented Apr 1, 2024

Hi folks, all my requests are returning datetime for the very first result only, all the others are 'datetime': nan.
Does anyone else facing the same issue or know how to solve it?

googlenews = GoogleNews(region='BR', lang='pt-BR')
googlenews.search('VALE3')
resultados = googlenews.results()

for i, resultado in enumerate(resultados):
    print(f"Resultado {i+1}: {resultado}")
    
Resultado 1: {'title': "Vale (VALE3): Analistas adotam 'postura conservadora'; entenda", 'media': 'Suno - Investimentos Inteligentes', 'date': 'á 22 minutos', 'datetime': nan,
Resultado 2: {'title': 'Vale (VALE3), Natura (NTCO3) e Hapvida (HAPV3) movimentam o mercado nesta segunda-feira; veja mais destaques', 'media': 'Suno - Investimentos Inteligentes', 'date': 'á 44 minutos', 'datetime': nan,
....
Resultado 121: {'title': 'Tebet não vê ingerência na Petrobras (PETR4) e na Vale (VALE3)', 'media': 'InfoMoney', 'date': 'á 4 horas', 'datetime': nan,

I'm working on version 1.6.14, under Python 3.11.5 on a Windows 10,

Many thanks :)

@HurinHu
Copy link
Member

HurinHu commented Apr 1, 2024

It seems the parser for datetime is not working in other languages, it is only working with English search.

@miraculix95
Copy link

yes, I have the same problem

@wastu01
Copy link
Contributor

wastu01 commented Sep 3, 2024

Have same problem on datetime in Chinese language.
all 'datetime' is nan.

@Ronkiro
Copy link

Ronkiro commented Sep 19, 2024

As shown in https://github.com/Iceloof/GoogleNews/blob/master/GoogleNews/__init__.py#L38 it uses "ago" keyword. One can fix it probably using their language's word (can be automated by some kind of i18n/translator, but i think it will be hard here)

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

5 participants