Skip to content

Instantly share code, notes, and snippets.

@kkc
Created December 6, 2013 06:13
Show Gist options
  • Select an option

  • Save kkc/7819336 to your computer and use it in GitHub Desktop.

Select an option

Save kkc/7819336 to your computer and use it in GitHub Desktop.
SgmlLinkExtractor
In [10]: fetch('http://www.last.fm/music/AC%252FDC/+images')
In [11]: lx = SgmlLinkExtractor(restrict_xpaths=('//a[@class="nextlink"]'))
In [12]: lx.extract_links(response)
Out[12]: [<Link url='http://www.last.fm/music/AC%2FDC/+images?page=2' text=u'Next' >]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment