from GoogleNews import GoogleNews import pandas as pd # get the news with lang and country parameters def get_news(lang, country, query): googlenews = GoogleNews(lang=lang, country=country) googlenews.search(query) result = googlenews.result() df = pd.DataFrame(result) return df