Skip to content

Commit

Permalink
Update ceshgi.py
Browse files Browse the repository at this point in the history
  • Loading branch information
feller2021 authored Jun 20, 2023
1 parent 3bc2fed commit bc65599
Showing 1 changed file with 23 additions and 32 deletions.
55 changes: 23 additions & 32 deletions ceshgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,19 @@ def shangchuang():
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.63",
"Connection": 'close'
}

with requests.Session() as up:
r = up.post(url, data=m,
headers=headers, timeout=(7,120),verify=False)

try:
time.sleep(10)
r = up.post(url, data=m,headers=headers, timeout=(7,120),verify=False)
except:
print("异常1")
time.sleep(10)
r = up.post(url, data=m,headers=headers, timeout=(7,120),verify=False)
finally:
print("异常2")
time.sleep(10)
r = up.post(url, data=m,headers=headers, timeout=(7,120),verify=False)
res=r.text
time.sleep(10)
jsonobj = json.loads(res)
Expand All @@ -112,45 +120,28 @@ def shangchuang():
"Connection": 'close'
}
with requests.Session() as up:
r = up.post(url, data=m,
headers=headers, timeout=(7,120),verify=False)

try:
time.sleep(10)
r = up.post(url, data=m,headers=headers, timeout=(7,120),verify=False)
except:
print("异常3")
time.sleep(10)
r = up.post(url, data=m,headers=headers, timeout=(7,120),verify=False)
finally:
print("异常4")
time.sleep(10)
r = up.post(url, data=m,headers=headers, timeout=(7,120),verify=False)
res=r.text
time.sleep(10)
jsonobj = json.loads(res)
msg=jsonobj['msg']
print(msg)
toCntPercent = jsonobj['objectId']
id=toCntPercent






















with open('id.txt', 'a') as f:
f.write('\n')
f.write(toCntPercent)
print(toCntPercent)



if __name__ == '__main__':
if not os.listdir(pt):
print("为空!我切片!")
Expand Down

0 comments on commit bc65599

Please sign in to comment.