Created
June 23, 2018 11:00
-
-
Save Suor/8200e6fa8c059ef36aa30bbdd5f70d12 to your computer and use it in GitHub Desktop.
Parse SWGOH zetas
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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