简体   繁体   中英

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 with 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:

and have a look at

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM