wget saves the page it loads to a file, while `` expects it to be output to stdout. Try `wget -q -O - $urlname`, -q telling it not to write information out to stderr and -O - to write the fetched webpage to stdout (- usually means stdout to unixy utilities). Or `curl -s $urlname`.