Skip to content Skip to sidebar Skip to footer

Feedparser - Keyerror: 'fullcount'

I have tried to follow this guide. It is about making a physical gmail notifier. When I entered the same code it found an error: Traceback (most recent call last): File 'C:/Pytho

Solution 1:

Just took a look at that from a REPL. The code will work as-is for me. However, I was able to reproduce your error by entering an incorrect password.

This is what feedparser.parse()['feed'] looks like if you fail to authenticate:

>>> feedparser.parse(PROTO + USERNAME + ":" + INCORRECT_PASSWORD + "@" + SERVER + PATH)['feed']
{'summary': u'<h1>Unauthorized</h1>\n<h2>Error 401</h2>'}
>>> 

This is what it should look like if you do authenticate properly:

>>> import pprint
>>> pprint.pprint(feedparser.parse(PROTO + USERNAME + ":" + PASSWORD + "@" + SERVER + PATH)['feed'])
{'fullcount': u'0',
 'link': u'http://mail.google.com/mail',
 'links': [{'href': u'http://mail.google.com/mail',
            'rel': u'alternate',
            'type': u'text/html'}],
 'subtitle': u'New messages in your Gmail Inbox',
 'subtitle_detail': {'base': u'https://mail.google.com/mail/feed/atom',
                     'language': None,
                     'type': u'text/plain',
                     'value': u'New messages in your Gmail Inbox'},
 'title': u'Gmail - Inbox for xxxxxxx@gmail.com',
 'title_detail': {'base': u'https://mail.google.com/mail/feed/atom',
                  'language': None,
                  'type': u'text/plain',
                  'value': u'Gmail - Inbox for xxxxxxx@gmail.com'},
 'updated': u'2013-03-01T20:11:03Z',
 'updated_parsed': time.struct_time(tm_year=2013, tm_mon=3, tm_mday=1, tm_hour=20, tm_min=11, tm_sec=3, tm_wday=4, tm_yday=60, tm_isdst=0)}
>>> 

You should print out the result of feedparser.parse() to check if this is indeed the problem you have, but I suspect that simply making sure your username/password are correct will fix your problem

Post a Comment for "Feedparser - Keyerror: 'fullcount'"