Jordando
Jordando

Reputation: 356

How to visit (not download) a page using curl or wget

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

Answers (2)

Christian Michael
Christian Michael

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

Spencer D
Spencer D

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

Related Questions