Posted to tcl by mjanssen at Tue Jul 24 13:08:42 GMT 2007view pretty

#!/bin/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 <myroot>$page</myroot>]
set root [$doc documentElement]
set nodes [$root selectNodes {//div[@id="keys"]/p/span}]
foreach node $nodes {puts [$node asText]}