0

I am using feedparser to parse RSS feed from spotcrime

However, I am getting "no attribute" error whenever I'm trying to loop through the entries to get the 'geo_long' and 'geo_lat' attribute.

If I don't loop than it works fine:

f = feedparser.parse(link)
entries = f.entries
print entries[0].geo_long

But when I do it in a loop like this, it starts giving me error

for e in entries:
    print e.geo_long

And this error is only for geo_long/geo_lat/where attribute on my feed. Other attributes work just fine when accessed in a loop. Can someone please let me know the problem? Thanks

Kim G Pham
  • 145
  • 6

1 Answers1

0

I found a way to go around this by using e.get('geo_long') instead and it worked. Still don't know why the other way does not work though

Kim G Pham
  • 145
  • 6