使用 node.js 抓取需要身份验证的网站 [英] Scraping a website which requires authentication using node.js
本文介绍了使用 node.js 抓取需要身份验证的网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试废弃这个网站 https://www.erobertparker.com/entrance.aspx 它需要身份验证我正在使用请求模块来获得这样的身份验证,
I am trying to scrap this website https://www.erobertparker.com/entrance.aspx it requires authentication I am using request module to get authenticated like this,
request({
url:"https://www.erobertparker.com/login.aspx",
method:"POST",
form:{UNENTRY:"username",PWENTRY:"password"}
},
function(error,response,body){
})
但我无法通过身份验证我做错了什么有人可以指导我我是网络抓取世界的新手:)
but i am unable to get authenticated what i am doing wrong can someone please guide me I am new to web scraping world :).
推荐答案
它使用了一个 asp.net 会话 cookie.您可能需要将所有 cookie 存储在一个 jar 中,然后在下一个请求时将它们发回.
It's using an asp.net session cookie. You possibly need to store all cookies in a jar and then send them back on the next request.
这篇关于使用 node.js 抓取需要身份验证的网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文