How do I write a code for saving a web page to a file?

Please give me some hints....