服务器端浏览器 [英] server side browser

查看:159
本文介绍了服务器端浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以在服务器端运行浏览器(特别是浏览器引擎)。我不只是想渲染一个页面,而是让浏览器打开一段时间,运行一些JS,点击一下或按一些键,同时抓住图形输出。



<有谁知道如何做到这一点?到目前为止,我唯一的想法是在VNC,RDP等会话中运行浏览器,但这似乎对我来说太过分了。

解决方案

PhantomJS做你所描述的。它基本上是一个无头浏览器 - http://phantomjs.org/



您可以通过任何服务器端语言运行服务器端。请参阅下面的NodeJS和PHP的一些集成模块



NodeJS



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



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



PHP



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


I was wondering if it is possible to run a browser (specifically a browser engine) on the server side. I do not just mean to render a page but to keep a browser open for some time, run some JS, do some clicks or press some keys and meanwhile grab the graphical output.

Does anyone know how to accomplish this? So far my only idea was to run the browser in a VNC, RDP etc. session but this seems like an overkill to me.

解决方案

PhantomJS does what you are describing. It is basically a headless browser - http://phantomjs.org/

you can run it server side via 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

这篇关于服务器端浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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