Possible Duplicate:
Server side browser that can execute JavaScript
Execute javascript in PHP
How can I parse HTML that includes JavaScript code, preferably with PHP script if possible.
As an example:
<a href="javascript:link(10, true);">link</a>
should be replaced by the appropriate value the JavaScript function returns, e.g.
<a href="http://www.example.com">link</a>
A more complex example would be a saved facebook html page which is littered with loads of javascript code.
Summarized: Return a DOM for a page with html+javascript