from lxml import html
import requests
import json
data = []
tplist = requests.get("https://translationproject.org/domain/index.html")
if(tplist.status_code == 200):
tree = html.fromstring(tplist.content)
domains = tree.xpath('//table/tr/td[1]/a/text()')
for d in domains:
data.append({"name": d, "system": 0})
with open('offlate/data.json', 'w') as f:
f.write(json.dumps(data))