Skip to content

Instantly share code, notes, and snippets.

@pmtpro
Last active September 20, 2020 04:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmtpro/eac6989b32be64a9da2cede2dcd8aa46 to your computer and use it in GitHub Desktop.
Save pmtpro/eac6989b32be64a9da2cede2dcd8aa46 to your computer and use it in GitHub Desktop.
# nhap thu vien
import requests, tabulate, json
# lay thong tin
year = input('Year: ')
id = input('ID: ')
# lay ket qua
request = 'https://diemthi.vnanet.vn/Home/SearchBySobaodanh?code=%s&nam=%s' %(id, year)
data = json.loads(requests.get(request).text)
# kiem tra ket qua
if (data['result']):
# lay du lieu
data = data['result'][0]
# xoa du thua
del data['CityCode']
del data['CityArea']
del data['KHXH']
del data['ResultGroup']
del data['Result']
data = list(data.items())
print(tabulate.tabulate(data, tablefmt = 'github'))
else:
print('Error')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment