HTML to TEXT style (News story)

Hi

I would like to get news in text in Jupyter Notebook.

But I can get news only in HTML.

How can I get text style news story?

headlines = ek.get_news_headlines('IBM')
for index, headline_row in headlines.iterrows():
story=ek.get_news_story(headline_row['storyId'])

print (story, content-Type: text/html)

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    With Jupyter Notebook, you can use HTML() to display it as HTML.

    from IPython.display import HTML
    ...

    headlines = ek.get_news_headlines('IBM')
    for index, headline_row in headlines.iterrows(): story=ek.get_news_story(headline_row['storyId'])

    HTML(story)

    image

Answers