Skip to content

Instantly share code, notes, and snippets.

@mwicat
Created April 28, 2012 10:12
Show Gist options
  • Select an option

  • Save mwicat/2517695 to your computer and use it in GitHub Desktop.

Select an option

Save mwicat/2517695 to your computer and use it in GitHub Desktop.
parse html
from BeautifulSoup import BeautifulSoup
import sys
soup = BeautifulSoup(sys.stdin.read())
inp = soup.find(lambda t: t.get('name') == 'LDAPserver')
if inp is not None: print inp['value']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment