I want to strip some data from a webpage.
Now the problem is, the data I want, is always in de the same line, but not in the exact same place at all times.
My problems concerns 2 lines:
Line 1:
Code: Select all
<tr><td bgcolor=#B8C5E2 align=right> </td><td bgcolor=#C9D3E9>Total number of page views up till now</td><td nowrap bgcolor=#C9D3E9>145683</td></tr>
Code: Select all
<tr><td bgcolor=#B8C5E2 align=right> </td><td bgcolor=#C9D3E9>6 March 2004</td><td align=right bgcolor=#C9D3E9>342</td></tr>
The way I do this now (and not working correctly) is this:
Code: Select all
set url1 "http://www.nedstatbasic.net/s?tab=1&link=1&id=2532130"
set temp1 [http::geturl $url1 -timeout 5000]
set data1 [http::data $temp1]
set stap1 [split $data1 \n]
set l1stap2 [lindex $stap1 115]
set l1stap3 [string range $l1stap2 0 [expr [strlen $l1stap2]-11]]
set l1stap4 [string range $l1stap3 137 end]
set hits $l1stap4
The second line is the most variable, because of the changing data in the line. In this example line I want to capture: 342
Could someone help me?
thx.
Chrizz