Iceloof/GoogleNews

'get_news' search function returns NoneType error

wcorona269 opened this issue · 3 comments

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

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

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'

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