Iceloof / GoogleNews

Script for GoogleNews
https://pypi.org/project/GoogleNews/
MIT License
314 stars 88 forks source link

'get_news' search function returns NoneType error #132

Closed wcorona269 closed 7 months ago

wcorona269 commented 7 months ago

When I run the 'get_news()' function on a GoogleNews object it returns the error - error ''NoneType' object has no attribute 'find'". However, when I run the 'search' function on the same GoogleNews object it works perfectly fine. Something wrong with the get_news() function.

@bp.route('/news', methods=['POST'])
def fetchTopNews():
    gNews = GoogleNews(period='2d')
    news_articles = []
    gNews.clear()
    gNews.get_news('top news') # this code errors out
    gNews.search('top news') # this code works
HurinHu commented 7 months ago

This issue is fixed by latest version (v1.6.11)

wcorona269 commented 7 months ago

I upgraded project to latest version of GoogleNews and am still having the same issue. search() works fine but get_news() returns nothing and gives error 'NoneType' has no attribute 'find'

HurinHu commented 7 months ago

I upgraded project to latest version of GoogleNews and am still having the same issue. search() works fine but get_news() returns nothing and gives error 'NoneType' has no attribute 'find'

Use print(googlenews.getVersion()) to make sure you get version 1.6.11