Iceloof/GoogleNews

Datetime not available

Opened this issue · 4 comments

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 :)

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

yes, I have the same problem

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

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)