Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nazt/372093 to your computer and use it in GitHub Desktop.
Save nazt/372093 to your computer and use it in GitHub Desktop.
def nekoParser = new org.cyberneko.html.parsers.SAXParser()
nekoParser.setFeature('http://xml.org/sax/features/namespaces', false)
/*nekoParser.setFeature('http://cyberneko.org/html/features/scanner/style/strip-comment-delims', true)
nekoParser.setFeature('http://cyberneko.org/html/features/scanner/script/strip-comment-delims', true) */
nekoParser.setFeature('http://cyberneko.org/html/features/scanner/ignore-specified-charset', true)
nekoParser.setProperty('http://cyberneko.org/html/properties/default-encoding',"TIS-620")
def page = new XmlSlurper(nekoParser).parse("http://www.google.co.th")
def links = page.depthFirst().grep{ it.name()=="IMG" && [email protected]().contains("something") }.'@src'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment