Skip to content

Instantly share code, notes, and snippets.

@TheCatPlusPlus
Created November 17, 2014 09:04
Show Gist options
  • Save TheCatPlusPlus/86ff05a1abcaacac5d96 to your computer and use it in GitHub Desktop.
Save TheCatPlusPlus/86ff05a1abcaacac5d96 to your computer and use it in GitHub Desktop.
sibling = h5.nextSibling
skipped = []
while isinstance(sibling, NavigableString) and sibling.strip() == u'':
skipped.append(sibling)
sibling = sibling.nextSibling
if (
sibling is not None and not isinstance(sibling, NavigableString) and
sibling.name == u'p' and sibling.string is not None and
(u'photo:' in sibling.string.lower() or u'photo by' in sibling.string.lower())
):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment