军事理论爬虫

一次简单的爬虫尝试

学校军事理论有个脑瘫的学时系统,必须在线时长并且不断阅读文章才行,帮学弟整了个脚本,全自动刷分,省去了分析过程(我也找不到当时截图了)

import requests
import time
import random
session = requests.session()
url1 = “http://210.29.200.173/junshi/loginproc.asp"
querystring = {“codeNeed”:”1”,”username”:”2017146113”,”userpass”:”123456”,”login.x”:”17”,”login.y”:”13”}
headers = {
‘User-Agent’: “PostmanRuntime/7.20.1”,
‘Accept’: “/“,
‘Cache-Control’: “no-cache”,
‘Postman-Token’: “434c468c-d979-4674-ade8-ad859aa06f05,7df410d7-eda5-494f-830b-fa8e83442481”,
‘Host’: “210.29.200.173”,
‘Accept-Encoding’: “gzip, deflate”,
‘Content-Length’: “0”,
‘Connection’: “keep-alive”,
‘cache-control’: “no-cache”
}
response = session.request(“POST”, url1, headers=headers, params=querystring)

#print(response.text)
print("login successfully")
print(session.cookies)
url2 = "http://210.29.200.173/junshi/sicq/read.asp"
while(1):
     response1 = session.get(url2)
     #response2 = session.get("http://210.29.200.173/junshi/Gjszz/Gjszz_1_"+str(random.randint(1,3))+".asp")
     response2 = session.get("http://210.29.200.173/junshi/Jssx/Jssx_3_" + str(random.randint(1, 3)) + ".asp")
     #print(response3.text.encode('iso-8859-1').decode('GBK'))
     time.sleep(1)