Server side browser that can execute JavaScript

2020-03-02 04:57发布

Is there any programming libraries available that will parse an HTML document, execute JavaScript and then allow me to navigate the DOM?  This needs to be performed server side, not client side. Any language will do, but Java, PHP, or Ruby are preferred.

9条回答
\"骚年 ilove
2楼-- · 2020-03-02 05:37

Start from this post and follow a links. Or just search for Rhino.

查看更多
时光不老,我们不散
4楼-- · 2020-03-02 05:44

PhantomJS does this and can be used with any server side language. See some integration modules below for NodeJS and PHP

NodeJS

https://npmjs.org/package/node-phantom

https://github.com/sgentle/phantomjs-node

PHP

https://github.com/diggin/php-PhantomjsRunner

查看更多
登录 后发表回答