From c09d449902f529db6fe390b22307a237124410de Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Sat, 7 Dec 2019 03:16:43 +0100 Subject: add chatlink + revenant legends support --- make_table.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 make_table.py (limited to 'make_table.py') diff --git a/make_table.py b/make_table.py new file mode 100644 index 0000000..18a30fa --- /dev/null +++ b/make_table.py @@ -0,0 +1,19 @@ +import requests +import json +from lxml import html, etree + +data = requests.get("https://wiki.guildwars2.com/wiki/Chat_link_format") +parsed = html.fromstring(data.content) +body = parsed.find(".//table") +iterator = iter(body) +next(iterator) +result = [] +for row in iterator: + if "-" in row[3].text: + continue + ids = row[3].text.strip().split(";") + palette_id = int(row[4].text) + for skill_id in ids: + skill_id = int(skill_id) + result.append((skill_id, palette_id)) +print(json.dumps(result)) -- cgit v1.2.3