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 badges4 Answers
Reset to default 3I'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.