aboutsummaryrefslogtreecommitdiff
path: root/make_table.py
diff options
context:
space:
mode:
Diffstat (limited to 'make_table.py')
-rw-r--r--make_table.py19
1 files changed, 19 insertions, 0 deletions
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))