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))