How to get a list of available files using wget or curl?

I would like to know if it is possible to make ls urls, so I can see that * .js files are available on the website, for example. Something like:

 wget --list-files -A.js stackoverflow.com 

and get

 ajax/libs/jquery/1.7.1/jquery.min.js js/full.js js/stub.js ... 
+7
source share
1 answer

You cannot make the equivalent of ls unless the server provides such lists. However, you can get index.html and then check if it includes, for example. something like

 wget -O - http://www.example.com | grep "type=.\?text/javascript.\?" 

Please note that this depends on whether the HTML is formatted in a certain way - in this case, for example, with separate lines. If you want to do it right, I would recommend parsing HTML and extracting javascript has included this path.

+5
source

All Articles