J
J
Jay Marlow2016-10-23 14:15:15
linux
Jay Marlow, 2016-10-23 14:15:15

How to fix an error in the code when running on Ubuntu?

Good day.
The question will seem strange, but the code below runs perfectly and parses the title and text of the news from rss on a Windows system.

rssurl = 'https://news.yandex.ru/security.rss'
feed = feedparser.parse(rssurl)
title = feed['entries'][1]['title']
text = feed['entries'][1]['summary']

The same code, run on Ubuntu python3 test.py - produces
title = feed['entries'][1]['title']
IndexError: list index out of range.

Question - why so? After all, there is no difference - in both systems python3.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question