am i using findNextSibling wrong?

localpricemaps at localpricemaps at
Tue Jan 24 19:01:12 CET 2006

i have this html:

<td class="price">

    <a class="nojs" name="D1L4" href="/xPopups/nojs"

                <div class="food">1.05</div>

                <div class="drink">3</div>

        <a class="btn" name="D1" href=""
target="_blank" onclick="reload()">

i tried to this use this python to scrape out the href and

for incident in row('td', {'class':'price'}):
  n = incident.findNextSibling('a')
  b = n.findNextSibling('div')
  c = b.findNextSibling('div')
  d = c.findNextSibling('a', {'class': 'btn'}')
  info = d['href'] + "','"
  print info

and i tried this
	for incident in row('td', {'class':'price'}):
       		n = incident.findNextSibling('a', {'class': 'btn'})
       		info = n['href'] + "','"
		print info

More information about the Python-list mailing list