我写了一个爬虫,但是爬的页面需要登录。而且不是普通的那种登录,
而是 如图:
请问在node 中如何 输入这种用户名和密码?
那么请问:
如下的 requrest headers
我用 如下的 node request 组件去模拟。
var options = {
url: 'http://cn-s-vtnet40.cn.abb.com/IprocessSWF/awdbau/Display?queueID=58b16290-257b-4c6e-82cd-18fb17ef6a97',
headers: {
'User-Agent': 'request',
'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
'Authorization':'Negotiate TlRMTVNTUAADAAAAGAAYAKIAAAB0AXQBugAAAAAAAABYAAAALAAsAFgAAAAeAB4AhAAAABAAEAAuAgAAFYKI4goA1zoAAAAPzMxrCPKh9QEx2sQsjcVNzUQAbwBuAGcAWQBhAG4AZwAuAEwAaQBAAGMAbgAuAGEAYgBiAC4AYwBvAG0ATABBAFAAVABPAFAALQBPAFUATQBLAE4AMgAzAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAjklduhxwu4iO0OC/nzIb3AEBAAAAAAAAU82vhGAs0wFBhATZ/39fzwAAAAACABYAQQBTAEkAQQBQAEEAQwBJAEYASQBDAAEAGABDAE4ALQBTAC0AVgBEAE4ARQBUADQAMAAEACYAYQBzAGkAYQBwAGEAYwBpAGYAaQBjAC4AYQBiAGIALgBjAG8AbQADAC4AQwBOAC0AUwAtAFYARABOAEUAVAA0ADAALgBjAG4ALgBhAGIAYgAuAGMAbwBtAAUADgBhAGIAYgAuAGMAbwBtAAcACABTza+EYCzTAQYABAACAAAACAAwADAAAAAAAAAAAQAAAAAgAABfNwvufQg0a7aFWZeALWT6tH/s3Hk2qvpGhYUj2QHPkgoAEAAAAAAAAAAAAAAAAAAAAAAACQA4AEgAVABUAFAALwBDAE4ALQBTAC0AVgBEAE4ARQBUADQAMAAuAGMAbgAuAGEAYgBiAC4AYwBvAG0AAAAAAAAAAAAAAAAA2FD36r5NoSB/oqIPFE9nfg==',
'Cookie':'ASP.NET_SessionId=yxneiqxs55gtttbhpr2v1ccp; _gat=1; _ga=GA1.2.548323792.1505115839; _gid=GA1.2.1779367607.1505115839',
'Host':'cn-s-vdnet40.cn.abb.com'
}
还是无法登陆,请问应该如何写? 谢谢大家。
抓包。看点登陆后发出去的包什么样的。
是不是basic认证?不管如何应该先查看响应代码
试试cookie,参考:http://www.jianshu.com/p/87867f325184
你用浏览器f12或者httpwatcher或fiddler或者wireshark等,走一遍流程,然后按到这个流程的数据发送就行了
这个是用了http认证,
从