Client said "there is a blank box when I try to retrive data out of codebook. there is no error message per se. you can see there is an empty dataframe when I try to run this script
import refinitiv.data as rd
from refinitiv.data.content import news
from IPython.display import HTML
import pandas as pd
import numpy as np
from datetime import datetime,timedelta
import time
import warnings
warnings.filterwarnings("ignore")
rd.open_session()
dNow = datetime.now().date()
maxenddate = dNow - timedelta(days=7) #upto months=15
compNews = pd.DataFrame()
riclist = ['VOD.L','HD','MSFT.O'] # can also use Peers, Customers, Suppliers, Monitor, Portfolio to build universe
for ric in riclist:
try:
cHeadlines = rd.news.get_headlines("R:" + ric + " AND Language:LEN AND Source:RTRS", start= str(dNow),
end = str(maxenddate), count = 10)
cHeadlines['cRIC'] = ric
if len(compNews):
compNews = pd.concat([compNews,cHeadlines])
else:
compNews = cHeadlines
except Exception:
pass
compNews