Closed kiddkrypto closed 2 years ago
Region parameter is not always working, as it is not part of google search, it can only restrict to the language like this,
googlenews = GoogleNews(period='7d', encode='utf-8', lang='zh-CN', region='CN')
googlenews.search('Covid-19')
From your example that should work right? I am getting an error when I use that that region flag.
What error do you get? This example should work with Chinese characters result.
For Chinese or any region is get "got an unexpected keyword argument 'region'"
It seems you are using old version, please follow the Readme to upgrade to latest version
Ok thank you that did work.
One more question around this, my server in the USA will work for fetching Google for sentiment analysis but in Brazil it doesn't work for more than 20 minutes before it gets an error of 'http error 429: too many requests'
I have the same code on my usa server but doesn't have this error.
Can you point me in the right direction for this?
It is not suggested to use on server, cloud server usually will be recognized as robot by Google and it may be easily exceed the maximum request rates or even blocked.
Ok, so my problem is I have an algorithm that is using the Google news feeds but the exchange that I need to use doesn't work for USA people. While back testing from my us server it works but even backtesting from a server outside of us it doesn't work for longer than 30 minutes.
How would I get around this?
If it can work sometimes, but not longer than 30 minutes, then you might need to set some random delays between calls
I have tried using the region option but I get an error.