Eikon API extract table from the news

Hi,

I used eikon api to extract the news with news id, however, the output is in URL format. I am wondering how I can extract the table from the news.

The news id is

'urn:newsml:newswire.refinitiv.com:20221207:nL4N32X0DW:1'


pls check the pics below, one is the output from the code and the other is the expected output from the newscapture.png1670536702462.png

Best Answer

  • wasin.w
    wasin.w admin
    Answer ✓

    Hello @rayr.hou

    Thank you for contacting us. This is an expected behavior, the News data always returns raw content with embedded raw HTML formatting. The application needs to parse and display it.

    If you are using Jupyter Notebook, you can use the IPython.display.HTML object to parse the story data as follows:

    from IPython.display import HTML
    story_id = 'urn:newsml:newswire.refinitiv.com:20221207:nL4N32X0DW:1'
    story = ek.get_news_story(story_id)
    HTML(story)

    Result:

    news-eikon.png

    Please see more detail on the Eikon_Data_API_News.ipynb example code in the CodeBook app.