php and server side javascript
<p>I am dealing with a problem where I need to do few thing at the SERVER SIDE using JAVASCRIPT (I am using php + apache combination )-</p>

<ol>
<li>read source of url using curl</li>
<li>run it through some server side JavaScript and get DOM out of it</li>
<li>traverse and parse the DOM using pre-existing java script code.This code works fine in a browser.</li>
</ol>

<p>I goggled and found <a href="http://pecl.php.net/package/spidermonkey" rel="nofollow">http://pecl.php.net/package/spidermonkey</a> , which allows us to run java script at server.is there any better way to achieve this? can we use Mozilla engine to get DOM out of HTML source code and process it using java script ? </p>

<p>Thanks in advance</p>
