简体   繁体   English

如何在node.js`request`模块中获取`location.href`重定向页面?

[英]How can I get `location.href` redirected page in node.js `request` module?

If I get a page which shows waiting message and it contains markup like this: 如果我得到一个显示等待消息的页面,并且其中包含这样的标记:

<body onload="location.href='redirect.html';">

This waiting page and redirect.html both get 200 OK in broswer, 这个等待页面和redirect.html在浏览器中都获得200 OK

but request module seems like only follow 3xx redirect in HTTP response. request模块似乎仅在HTTP响应中遵循3xx重定向。

How can I get redirect.html by using request module? 如何使用request模块获取redirect.html

如果我对您的理解正确,则可以例如通过regex解析新的href并发出新请求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM