Reputation: 356
I am very new to wget/curl. I am trying to get a page to execute its html/scripts using wget/curl. I do not care about downloading the actual page, just that the scripts on the page run. Is there a command to do this?
Thanks!
Upvotes: 1
Views: 2374
Reputation: 2316
If you just want to call a PHP script you can do:
curl http://your-domain.com/script.php
But with just wget your script will be downloaded:
wget http://your-domain.com/script.php
But with wget -q -O you can call the script like curl:
wget -q -O http://your-domain.com/script.php
Upvotes: 2
Reputation: 3486
cURL and wget are used to transfer files/content to/from a specified location. As such, cURL and wget are neither suitable for actually rendering web pages nor executing JavaScript on those webpages. While cURL can be used to output received data to stdout, it is still not designed to render that data.
If you would like to use the terminal to execute JavaScript within a webpage, you may want to consider looking into PhantomJS. PhantomJS can load local HTML files and interact with/execute their JavaScript.
Upvotes: 3