python在关闭代理进行post请求

import requests
import json
import time
import winsound
import os
## 不要用sleep做定时任务
url = "https://yqgz.beijing.gov.cn/service/returnBj/checkPersonApplyStatus"
data = {"idCard":"Z67suHrh9+9SzE+2RM5s1C1q9ECFFRB4J6eh6dOCgOo="}
#data = {"idCard":"Z67suHrh9+9SzE+2RM5s1C1q9ECFFRB4J6eh6dOCgo="}
#proxies = {"http":None,"https":None}
os.environ['NO_PROXY'] = 'yqgz.beijing.gov.cn'
i=0
while(True):
    #r = requests.post(url,json=data,proxies=proxies)
    r = requests.post(url,json=data)
    result = json.loads(r.text)
    print(i,result,time.time())
    checkState = result['data']['checkState']
    checkMessage = result['data']['checkMessage']
    if checkState != 102 or checkMessage != '审批中':
        while(True):
            winsound.Beep(600,1000)
            time.sleep(0.5)
            winsound.Beep(2000,1000)
            time.sleep(0.5)
    time.sleep(10)
    i+=1

你可能感兴趣的:(python,python,开发语言,json)