World-News-Analysis / wna_googlenews.py
Roozeec's picture
Added settings
bcfdcee
raw
history blame
No virus
353 Bytes
from GoogleNews import GoogleNews
import pandas as pd
# get the news with lang and country parameters
def get_news(settings, query):
googlenews = GoogleNews(
lang=settings["lang"],
region=settings["region"],
period=settings["period"],
)
googlenews.search(query)
result = googlenews.result()
df = pd.DataFrame(result)
return df