Skip to content

Instantly share code, notes, and snippets.

@antiface
Forked from Gunio/Parsing HTML in Python
Created September 18, 2013 06:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antiface/6605151 to your computer and use it in GitHub Desktop.
Save antiface/6605151 to your computer and use it in GitHub Desktop.
import requests
import lxml
from lxml import html
r = requests.get('http://gun.io')
tree = lxml.html.fromstring(r.content)
elements = tree.get_element_by_id('frontsubtext')
for el in elements:
print el.text_content()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment