NodeJS获取完全渲染的HTML页面 [英] NodeJS Get Completely Rendered HTML Page

查看:675
本文介绍了NodeJS获取完全渲染的HTML页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在JavaScript完全加载并完全呈现页面后使用NodeJS从url获取html页面内容,或者获取基本html然后运行所有JavaScript文件以获取最终内容. 例如,假设有一个基于AngularJS的网站,那么基本的html很简单,但是在页面中加载所有JavaScript代码后,页面内容完全不同.我想在服务器上获取最终的内容以在其中找到某些内容.有什么想法吗?

I want to get a html page content from a url using NodeJS after JavaScript is fully loaded and the page is completely rendered, or get the basic html then run all JavaScript files to achieve final content. For example let's assume there is a website based on AngularJS, so the basic html is simple, but after loading all JavaScript codes in the page, page content is completely different. I want to get that final content on my server to find something in it. Any ideas?

推荐答案

也许为时已晚,但是在过去,PhantomJS解决了我的问题.

Maybe it's too late, but back in the day, PhantomJS solved my problem.

这篇关于NodeJS获取完全渲染的HTML页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆