For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
11 2 2 3

get_news_headline & _story

Hi all,

My clients want to get news and its story without any tags(eg </p>or<p>) Is it possible to get news only readable story? Plus, to search news RIC or Topic are available?(eg LJA(Japanese news all) or FRX(FX news all) Any information is appreciated.

Kind regards, Koji

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythonnews
icon clock
10 |1500

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

1 Answer

Upvote
Accepted
4.6k 26 7 22

The news query language is fully supported, so you can construct your query in the News monitor app first.

Consider using a third-party library for getting the raw text out of html such as BeautifulSoup4 or any other alternative.

from bs4 import BeautifulSoup
import eikon as tr
tr.set_app_id('sample')
story = tr.get_news_story(story_id='urn:newsml:reuters.com:20180129:nKjtAFQj:1')
soup = BeautifulSoup(story, 'html5lib')
soup.get_text()


icon clock
10 |1500

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

Click below to post an Idea Post Idea