2

I am trying to run example from feedparser documentation

What I have tried so far

import feedparser
d = feedparser.parse('http://feedparser.org/docs/examples/atom10.xml')
print d.etag

I am getting this error for etag

AttributeError: object has no attribute 'etag'

I have also tried

print d.modified

Same error

AttributeError: object has no attribute 'modified'

print d

gives me this

{'feed': {'summary': u''}, 'status': 302, 'version': u'', 'encoding': u'utf-8', 'bozo': 1, 'headers': {'content-length': '333', 'content-encoding': 'gzip', 'age': '1', 'expires': '-1', 'vary': 'Accept-Encoding', 'server': 'Microsoft-IIS/7.5', 'connection': 'close', 'pragma': 'no-cache', 'cache-control': 'no-cache', 'date': 'Tue, 19 Sep 2017 06:39:58 GMT', 'x-powered-by': 'ASP.NET', 'content-type': 'text/html; charset=utf-8', 'x-aspnet-version': '4.0.30319'}, 'href': u'http://feedparser.org/docs/examples/atom10.xml', 'namespaces': {}, 'entries': [], 'bozo_exception': SAXParseException('no element found',)}

There is no etag or modified key here. What am I missing?

Solaman Raji
  • 170
  • 9
  • 2
    Seems like the `http://feedparser.org/docs/examples/atom10.xml` no longer exist. Well more like the whole domain. Try accessing it from your browser. – Paco H. Sep 19 '17 at 06:52
  • 1
    @PacoH. You are right. The domain no longer exist. Now I have tried this [dummy url](http://www.feedforall.com/sample.xml). Got both **etag** and **modified**. – Solaman Raji Sep 19 '17 at 07:01

0 Answers0