模拟登录总是失败,为什么一直反回的都是之前取cookie的html?

newbility-xp 发布于 2017/12/15 16:56
阅读 64
收藏 0

var request = require('request');

request({

method: 'GET',

url: 'http://202.118.163.67/',

proxy: 'http://neauproxy.feit.me:6000',

followRedirect: false,

},(err,res,html) => {

var cookie = res.headers['set-cookie'][0].split(';')[0];

// console.log(cookie);

 

request({

method: 'POST',

url: 'http://202.118.163.67/index.php',

proxy: 'http://neauproxy.feit.me:6000',

headers:{

'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',

'Accept-Encoding':'gzip, deflate',

'Accept-Language':'zh-CN,zh;q=0.9',

'Cache-Control':'no-cache',

'Content-Length':'63',

'Content-Type':'application/x-www-form-urlencoded',

'Cookie': cookie,

'Host':'202.118.163.67',

'Origin':'http://202.118.163.67',

'Pragma':'no-cache',

'Proxy-Connection':'keep-alive',

'Referer':'http://202.118.163.67/',

'Upgrade-Insecure-Requests':'1',

'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36',

 

 

},

form:{

'username':'A02160038',

'password':'19990103',

'Input2':'%E7%99%BB+%E5%BD%95'

}

},(err,res,html)=>{

console.log(html);

});

})

加载中
返回顶部
顶部