Skip to content

Instantly share code, notes, and snippets.

@peterix
Created April 7, 2015 22:08
Show Gist options
  • Save peterix/ea0a3fee9ba839a6c533 to your computer and use it in GitHub Desktop.
Save peterix/ea0a3fee9ba839a6c533 to your computer and use it in GitHub Desktop.
#!/bin/python2
from lxml import html
import requests
from operator import methodcaller
page = requests.get('https://www.patreon.com/user?u=130816&ty=p')
tree = html.fromstring(page.text)
patrons = tree.xpath("//div[contains(concat(' ', normalize-space(@class), ' '), ' shareWindow ')]/h1/a/text()")
print "\n".join(filter(None, map(methodcaller("strip"), patrons)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment