getting a KeyError:'href' any ideas?

homepricemaps at gmail.com homepricemaps at gmail.com
Thu Jan 5 19:20:31 CET 2006


i have an
href which looks like this:


<td class="all">
    <a class="btn" name="D1" href="http://www.cnn.com">
        </a>


here is my code

for incident in row('td', {'class':'all'}):
                n = incident.findNextSibling('a', {'class': 'btn'})
                link = incident.findNextSibling['href'] + "','"



and the full error is this:


  File "/home/felafela/BeautifulSoup.py", line 301, in __getitem__
    return self._getAttrMap()[key]
KeyError: 'href'


any idea what i'm doing wrong here with the syntax?  thanks in advance




More information about the Python-list mailing list