最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Server-side web browser for PHP? - Stack Overflow

programmeradmin0浏览0评论

If you wanted to re-create the DOM server-side and manipulate it in PHP, how would you choose to go about it?

I'm looking for a fast, multi-user plete server-side web browser that can interface with PHP and run plete Javascript.

Like Jaxer but something I can use with PHP... an extension would be fine, or even an Apache mod.

Ideas?

If you wanted to re-create the DOM server-side and manipulate it in PHP, how would you choose to go about it?

I'm looking for a fast, multi-user plete server-side web browser that can interface with PHP and run plete Javascript.

Like Jaxer but something I can use with PHP... an extension would be fine, or even an Apache mod.

Ideas?

Share Improve this question asked Mar 15, 2010 at 9:52 Lee BensonLee Benson 11.6k6 gold badges48 silver badges60 bronze badges
Add a ment  | 

4 Answers 4

Reset to default 3

I'd run Firefox on an instance of Xvfb and make sure the MozRepl plugin was installed.

I'd then connect to the MozRepl server from PHP (using the Perl module's source code to guide me in writing an API if I couldn't find a PHP one).

If you wanted to re-create the DOM server-side and manipulate it in PHP, how would you choose to go about it?

I'd use the DOM extension

I'm looking for a fast, multi-user plete server-side web browser that can interface with PHP and run plete Javascript.

Try any of these:

  • http://en.wikipedia/wiki/Server-side_JavaScript

and have a look at

  • http://forums.aptana./viewtopic.php?t=4603
  • http://code.google./p/pampa-j/
  • http://webreflection.blogspot./2009/03/php-to-jaxer-server-and-vice-versa.html

I don't know of any browser emulators for PHP that can execute javascript, but if you can do without that requirement, SimpleTest has a browser ponent that's pretty nifty. It's part of the SimpleTest suite, but it can easily be used on its own.

Otherwise, your best bet is probably to remote-control Firefox or a Webkit-based browser. You can use Xvfb (X virtual frame buffer) on Linux systems to run graphical programs under a scripting environment.

Node.js is causing a bit of a stir at the moment. Could be worth looking into more.

发布评论

评论列表(0)

  1. 暂无评论