0

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,

but request module seems like only follow 3xx redirect in HTTP response.

How can I get redirect.html by using request module?

Stephen Chen
  • 135
  • 3
  • 10
  • 1
    The `request` module alone isn't meant to do that. It's only defined to understand HTTP, not HTML or to evaluate client-side JavaScript. For the latter, there are numerous [headless browsers](https://stackoverflow.com/questions/814757/headless-internet-browser) that can be used. – Jonathan Lonowski May 20 '17 at 16:26

1 Answers1

0

If I understand you correctly you can just parse the new href for example via regex and do a new request.