开发者

Server-side web browser for PHP?

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 complete server-side web browser that can interface w开发者_JAVA百科ith PHP and run complete Javascript.

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

Ideas?


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 complete server-side web browser that can interface with PHP and run complete Javascript.

Try any of these:

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

and have a look at

  • http://forums.aptana.com/viewtopic.php?t=4603
  • http://code.google.com/p/pampa-j/
  • http://webreflection.blogspot.com/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 component 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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜