what is the syntax used to find a child of td? Mike Meyer wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > Please use less whitespace in your posts in the future. There's really > no need to put two blank lines between sections. > > > 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'] + "','" > > any idea what i'm doing wrong here with the syntax? thanks in advance > > It's not the syntax, it's the logic. the a element is not a sibling of > the td element, it's a child. findNextSibling is going to return the > next td, assuming there is one. Trying to index > incident.findNextSibling in the next line is also broken. That's a > method, not an indexable object. So that line will also break. > > <mike > -- > Mike Meyer <[EMAIL PROTECTED]> > http://www.mired.org/home/mwm/ > Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
-- http://mail.python.org/mailman/listinfo/python-list