Search code examples
linuxalmalinux

How to put the contents of a site into a file on Linux?


I have to make a script that uses a list of names in preperation for an exam. All this time I have just been using a file with the names, but well for the exam they will take the script and nothing else and it won't be able to run if it doesn't have the list of names.

So the website is just given to us by school, it's content is only a list of names, how do I put the names from this website into a file in my script?


Solution

  • Not a lot of information here. As in what language is your script in etc.

    Also isn't it easier to just get the contents of the url in your script?

    But okay, as for getting the webpage's content on linux you should be able to just use curl and write the output to a file.

    curl http://webage.com >> output.txt

    If there's actually html in there you might have to perform some string manipulation on it.