import requests,time,sys,re,json,schedule from datetime import date,datetime aa1='''Host: 10.255.0.2:8081 Content-Length: 83 Cache-Control: max-age=0 Upgrade-Insecure-Requests: 1 Origin: http://10.255.0.2:8081 Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 Referer: http://10.255.0.2:8081/?userip=172.16.128.15&usermac=c0b8e6f8b77a&info= Accept-Encoding: gzip, deflate Accept-Language: zh-CN,zh;q=0.9 Cookie: isRemember=true; username=%u9648%u4E14%u6D77; password=19660211 Connection: keep-alive''' def headxx(aab): abx=[] ax1=aab.split('\n') for i in ax1: ax2=i.split(': ') abx.append((ax2[0],ax2[1])) tt=dict(abx) return tt def denglu(): print("the time:%s"% datetime.now()) url="http://10.255.0.2:8081/login.html" ## aa1='''Host: 10.255.0.2:8081 ## Content-Length: 83 ## Cache-Control: max-age=0 ## Upgrade-Insecure-Requests: 1 ## Origin: http://10.255.0.2:8081 ## Content-Type: application/x-www-form-urlencoded ## User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 ## Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 ## Referer: http://10.255.0.2:8081/?userip=172.16.128.15&usermac=c0b8e6f8b77a&info= ## Accept-Encoding: gzip, deflate ## Accept-Language: zh-CN,zh;q=0.9 ## Cookie: isRemember=true; username=%u9648%u4E14%u6D77; password=19660211 ## Connection: keep-alive''' data1="signname=Red-Giant&username=%B3%C2%C7%D2%BA%A3&password=19660211&signname=Red-Giant" head1=headxx(aa1) aa=requests.post(url,headers=head1,data=data1) schedule.every().day.at("04:01").do(denglu,) schedule.every().day.at("04:05").do(denglu,) print("the time:%s"% datetime.now()) #denglu() while 1: schedule.run_pending()
标签:8081,application,python,image,0.2,认证,##,10.255,定时 From: https://www.cnblogs.com/xkdn/p/16891290.html