[EMAIL PROTECTED] wrote: > mike's code worked like a charm. i have one more question. i have an > href which looks like this: > > <td class="all"> > <a class="btn" name="D1" href="http://www.cnn.com"> > </a> > > i thought i would use this code to get the href out but it fails, gives > me a keyerror: > > for incident in row('td', {'class':'all'}): > n = incident.findNextSibling('a', {'class': 'btn'}) > link = incident.findNextSibling['href'] + "','" > > > any idea what i'm doing wrong here with the syntax? thanks in advance >
ISTM that <a class="btn"> is a child of <td>, not a sibling, and findNextSibling is a method, not an indexable element. Try n = incident('a', {'class': 'btn'}) link = n['href'] + "','" Kent -- http://mail.python.org/mailman/listinfo/python-list