1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
| from ans_deal import work import requests map= [ [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0],
[1, 1, 1, 1, 0, 1, 1], [1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 0, 1, 1], [1, 1, 1, 0, 1, 0, 1], [0, 0, 0, 0, 0, 0, 0],
[1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 0],
[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], ] cookies = input() post_headers = { 'Host': '192.168.115.248:81', 'Connection': 'keep-alive', 'Pragma': 'no-cache', 'Cache-Control': 'no-cache', 'Upgrade-Insecure-Requests': '1', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8', 'Accept-Encoding': 'gzip, deflate', 'Accept-Language': 'zh,zh-CN;q=0.8', 'Cookie': 'NCCE=' + cookies } need = 2 SectionID = 0 SisterID = 0 ItemID = 0 for col in range(0, need): for row in range(0,23): UnitID = col + 1 if row <= 4: SectionID = 1 SisterID = row + 1 elif row <= 9: SectionID = 2 SisterID = row - 4 elif row <= 15: SectionID = 3 SisterID = row - 9 elif row <= 17: SectionID = 4 SisterID = row - 15 elif row <= 22: SectionID = 4 SisterID = row - 17 if map[row][col] == 1: url = 'http://192.168.115.248:81/book/book183/U'+str(UnitID)+'_S'+str(SectionID)+'_'+str(SisterID)+'.php' TestID = str(SectionID) + '.' + str(SisterID) KidID = '1' ItemID = col *23 + row + 1 print(url) ans = work(url, cookies) form = { 'UnitID': str(UnitID), 'SectionID': str(SectionID), 'SisterID': str(SisterID), 'TestID': TestID, 'KidID': KidID, 'ItemID': str(ItemID), 'Item_0':'' } for x,t in enumerate(ans): form['Item_' + str(x)] = t print(form) requests.post(url=url, headers = post_headers, data= form)
|