Skip to content

Instantly share code, notes, and snippets.

@elyase
Created November 20, 2013 02:55
Show Gist options
  • Save elyase/7556900 to your computer and use it in GitHub Desktop.
Save elyase/7556900 to your computer and use it in GitHub Desktop.
l = []
for th in d.items('.borderless td:nth-child(1)'):
left = th.text()
right = th.next().text()
tr = th.parent()
tbody = tr.parent()
title = tbody('th:first').text() # first element
if title == 'NUANS Reports & Preliminary Searches' and right in ['Active', 'Inactive']:
l.append([left, right])
1 loops, best of 3: 199 ms per loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment