Posted to tcl by rfoxmich at Tue Jul 24 12:14:43 GMT 2007view pretty

#!/bin/sh
# This line continues for Tcl, but is a single line for 'sh' \
exec tclsh8.4 "$0" ${1+"$@"}
package require tdom
package require http
set url "http://localhost"
set page [::http::data [::http::geturl $url]]
set doc [dom parse -html $page]
set root [$doc documentElement] 
puts [$root asXML]