import requests
sess=requests.Session()
resp=sess.get('https://www.woniuxy.com/sys/user/captcha?t=Math.random();%27)
with open('woniu.png','wb') as f:
f.write(resp.content)
captcha=input('请输入验证吗')
data={
'captcha':captcha,
'password': "WYL20086922WYL",
'tel': "13515438691",
'loginType': '1'
}
headers={
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.7 Safari/537.36'
}
resp=sess.post('https://www.woniuxy.com/sys/user/login',data=data,headers=headers)
print(resp.text)
请输入验证吗3858
{
"code":500001,
"msg":"系统繁忙,请稍候再试"
}
进程已结束,退出代码0
求解答
给你修好了
import json
import requests
sess=requests.Session()
resp=sess.get('https://www.woniuxy.com/sys/user/captcha?t=Math.random();%27')
with open('woniu.png','wb') as f:
f.write(resp.content)
captcha=input('请输入验证吗')
data={
'captcha':captcha,
'password': "WYL20086922WYL",
'tel': "13515438691",
'loginType': '1'
}
headers={
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.7 Safari/537.36',
"Content-Type": "application/json",
}
resp=sess.post('https://www.woniuxy.com/sys/user/login',data=json.dumps(data),headers=headers)
print(resp.text)
爬虫?估计是被反爬了吧,这种很容易就被检测为机器登录