ComputerTech Owner
Posts : 99 Points : 268 Reputation : 0 Join date : 2020-04-30
| Subject: Demonds Http Page script 24/5/2020, 15:18 | |
| - Code:
-
#!/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://news.bbc.co.uk/sport" set page [::http::data [::http::geturl $url]] set doc [dom parse -html $page] set root [$doc documentElement] set node [$root selectNodes {//table[@width=416]/tr[1]/td[3]/div[2]}] set text [[[lindex $node 0] childNodes] nodeValue] puts "Latest sport news: [string trim $text]" | |
|