Last active
September 20, 2020 04:39
-
-
Save pmtpro/eac6989b32be64a9da2cede2dcd8aa46 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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