[英]How to load JavaScript enabled response using axios or fetch API in JavaScript?
我正在做一个个人项目,我想在其中阅读 JavaScript 相关网页的整个 HTML。 例如,如果我在 JavaScript 启用 web 浏览器中加载此 URL ,这就是我得到的:
但是,如果我在浏览器中禁用 JavaScript,并现在加载相同的 URL ,我会得到:
我知道这很正常。
Now I am trying to load the HTML of the same link in JavaScript code using axios HTTP client, and obviously I am getting the HTML of JavaScript disabled webpage as the HTTP response.
我想获取 HTML(+JS) 源作为同一链接的响应(其中启用了 JavaScript)。 I don't know how to mimic a JavaScript enabled Web Browser when working with HTTP clients like axios or fetch API.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.