Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wget + JavaScript?

I have this webpage that uses client-side JavaScript to format data on the page before it's displayed to the user.

Is it possible to somehow use wget to download the page and use some sort of client-side JavaScript engine to format the data as it would be displayed in a browser?

like image 439
Jake Wilson Avatar asked May 05 '11 17:05

Jake Wilson


People also ask

What is wget used for?

Wget is a networking command-line tool that lets you download files and interact with REST APIs. It supports the HTTP , HTTPS , FTP , and FTPS internet protocols. Wget can deal with unstable and slow network connections. In the event of a download failure, Wget keeps trying until the entire file has been retrieved.

How do I download using wget?

Let's start with something simple. Copy the URL for a file you'd like to download in your browser. Now head back to the Terminal and type wget followed by the pasted URL. The file will download, and you'll see progress in realtime as it does.

How does wget command work?

The wget command is a command line utility for downloading files from the Internet. It supports downloading multiple files, downloading in the background, resuming downloads, limiting the bandwidth used for downloads and viewing headers.


1 Answers

You could probably make that happen with something like PhantomJS

You can write a phantomjs script that will load the page like a browser would, and then either take screenshots or use JS to inspect the page and pull out data.

like image 151
Alex Wayne Avatar answered Oct 07 '22 14:10

Alex Wayne