how to browse a web site using script

hi guys,

ok this script, i am trying to browse a http site and store the output in a text file ...

when i run the script , i get a http compatibility error.

does any1 have a good solution to contact a http server and save the html in a text file.. i know the result comes with html tags.
Thank you

you can try to use wget

wget is the way to go but telnet would work for simple stuff.

you can also use lynx if you wanted.

lynx -source -accept_all_cookies "http://www.foo.com">>file.html

if you wanted...

thank you guys,

but the issue is i am workin on aix machine and i dont have wget tools installed. and installin wget is not an option. i am pasting my script here .. plz have a look at it ..

WEBSERVER=aix85
WEBPORT=9088
URLDIR=/DmMethods/servlet/DoMethod
TOFILE=result.txt
echo "before telnet"
telnet $WEBSERVER $WEBPORT |&   # Open pipe to web server
echo "After telnet"
IFS=~
read -p HEAD1 2>/dev/null                    # Ignore telnet headers
read -p HEAD1 2>/dev/null
read -p HEAD1 2>/dev/null
print -p "GET $URLDIR HTTP /1.1" 2>/dev/null    # Send HTTP request to server
print -p "" 2>/dev/null
read -p LINE 2>/dev/null
echo ${LINE}
if [ "${LINE}" != "HTTP/1.0 200 OK" -a "${LINE}" != "HTTP/1.1 200 OK" ]; then
  echo "ERROR: Invalid response from Web Server: ${LINE}"
  exit 8
fi
while [ "${LINE}" != "" ]                    # Skip HTTP Headers
do
  read -p LINE 2>/dev/null
done
while read -p LINE 2>/dev/null               # Process web page contents
do
  echo "${LINE}" >> result1.txt
done