2

The Java library HtmlUnit allows you to request a given url's content (and I'm told it will also execute the javascript that would execute on that page's load event). I'm looking for this same functionality but within PHP.

The problem that I'm trying to solve is that I'm attempting a curl/wget/get_file_contents to a url that has a bit of javascript that run on page load...this javascript is not executing with the methods that I'm using...and I'd like to use something that can achieve the "get" and additionally execute that page's javascript...so my result from the "get" would be the html markup after the initial javascript has executed.

Thanks

nfechner
  • 17,295
  • 7
  • 45
  • 64
tomwag
  • 197
  • 2
  • 10

1 Answers1

2

I googled a bit but could not find a port. For example this link tells that no port is available.

To test features of the cartoclient, the HttpUnit software is used. It is written in Java, and there is no Php port. The http unit tests are run if you have a JVM in you path.

Maybe PHPUnit with Selenium RC?

Selenium RC is a test tool that allows you to write automated user-interface tests for web applications in any programming language against any HTTP website using any mainstream browser. It uses Selenium Core, a library that performs automated browser tasks using JavaScript. Selenium tests run directly in a browser, just as real users do. These tests can be used for both acceptance testing (by performing higher-level tests on the integrated system instead of just testing each unit of the system independently) and browser compatibility testing (by testing the web application on different operating systems and browsers).

Alfred
  • 60,935
  • 33
  • 147
  • 186