Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
# -*- coding: utf-8 -*-
import requests
import lxml
import sympy
import numpy
def PeopleSetDetail(PeopleSetID, PrimeObsession=False):
site = ''
url = 'registry/comics/PeopleSetDetail.aspx?PeopleSetID=%s' % PeopleSetID
req = requests.get(site + url)
html = lxml.etree.HTML(req.text)
rows = html.xpath("//table[@class='TopSetsGrid']/tr")
data = list()
for row in rows:
cols = row.xpath("td/a/text()")
if sympy.isprime(cols[1]) or not PrimeObsession:
except (IndexError, ValueError):
return numpy.array(data)
print PeopleSetDetail(79399, PrimeObsession=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment