如何使用node.js后端提取受保护网页的状态代码?
我正在尝试仅访问网页的返回状态代码,但该页面由登录过程宣传。
我已经有凭据,但是我无法直接发送HTTP请求并查看状态代码,因为它返回了登录页面的HTML。
我需要找到一种方法,以便当我将HTTP请求发送到该Web服务时,它应该通过这些登录过程并仅返回我的状态代码。
一种建议的方法是使用脚本浏览器,但是即使我成功登录到该页面并显示它,我该如何将状态代码发送到本地后端?
I am trying to only access a webpage's returned status code but the page is proctected by a login process.
I already have the credentials but I cannot directly send http request and see the status code because it returns HTML of login page.
I need to find a way such that when I send http request to that web service, it should go through those login process and return me only status code.
An advised way is that using scripted browser, but still even if I successfully login to that page and display it, how can I send status code to my local backend ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果登录过程包括仅给出正确的用户名和密码,则可以使用单个请求“伪造”它,
但是如果登录涉及一次性令牌或CAPTCHAS,那么这当然不够。
If the logon process consists of just giving the correct username and password, you can "fake" it with a single request like
But if login involves one-time tokens or captchas, this is of course not sufficient.