[英]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.