Skip to content

Instantly share code, notes, and snippets.

@Suor
Created June 23, 2018 11:00
Show Gist options
  • Save Suor/8200e6fa8c059ef36aa30bbdd5f70d12 to your computer and use it in GitHub Desktop.
Save Suor/8200e6fa8c059ef36aa30bbdd5f70d12 to your computer and use it in GitHub Desktop.
Parse SWGOH zetas
import requests
import lxml.html
resp = requests.get('https://swgoh.gg/g/34508/darklightcrew/zetas/')
root = lxml.html.fromstring(resp.text)
rows = root.cssselect('.character-list table tbody tr')
for tr in rows:
nick = tr.cssselect('td:first-child')[0].attrib['data-sort-value']
chars = tr.cssselect('.guild-member-zeta')
for char in chars:
char_name = char.cssselect('.char-portrait')[0].attrib['title']
zetas = [x.attrib['title'] for x in char.cssselect('.guild-member-zeta-ability')]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment