question

Upvotes
Accepted
1 2 4 4

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

eikon-data-api#technologyapinews
capture.png (232.8 KiB)
1670536702462.png (88.5 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
Accepted
27.5k 67 18 14

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.


news-eikon.png (75.2 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.