before even writing a scripts you need a program(command) to get the source code. for instance this will download the soucecode of a page
wget http://www.daniweb.com/techtalkforums/thread7215.html
this will only work because it is an html file it is getting.
this technique will not work with
wget http://www.daniweb.com
because there is no html file to download.
The whole process of getting the html source code might be tricky