Skip to content

Instantly share code, notes, and snippets.

@ehmo
Created March 30, 2016 15:00
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 ehmo/2790b1467ff4180a4b116f7846cd24a2 to your computer and use it in GitHub Desktop.
Save ehmo/2790b1467ff4180a4b116f7846cd24a2 to your computer and use it in GitHub Desktop.
Regex in lxml
script = webpage.xpath(
"//script[re:match(text(), 'params')]",
namespaces={
"re": "http://exslt.org/regular-expressions"
}
)[0].text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment