title: Run JavaScript code on a page without showing browser window
body: <p>I have a question regarding JavaScript and methods by which its code can be run. As we know, there is some JavaScript code embedded in  tags and it runs natively within browser window - that's quite common and that's how the web pages currently work.</p>
  
  <p>If we want interaction out of the box with the web page we are surfing, we must use tool such as GreaseMonkey and write our UserScripts that allow us to change page behavior to our desired one. This still needs us to open browser window and visit our target.</p>
  
  <p>The question is: can we somehow run JavaScript code on a certain page without even opening browser window? I mean, in an ideal solution there would be a command-line tool that'd allow us to call:</p>
  
  <pre><code>./clibrowser http://google.com userscript.js
  </code></pre>
  
  <p>In which script, for example, we could run some AJAX code to fetch data coming from queries and pass it to some other PHP script that's save it to database.</p>
  
  <p>I think that this question simplifies to: <strong>are there any tools like "command-line browser" with JavaScript engine?</strong> I know, that it may sound strange, but I am curious just because of the idea I have in my mind.</p>