Posted to tcl by mjanssen at Tue Jan 02 22:16:53 GMT 2007view raw

  1. package require tdom
  2. package require http
  3.  
  4. set tok [http::geturl http://www.rocheck.de/index.php?si=suche&v=red%20potion&suche=okay]
  5. set data [http::data $tok]
  6.  
  7. set doc [dom parse -html $data]
  8. set items {}
  9.  
  10. foreach href [$doc selectNodes {//td[@width="350"]/descendant::*/@href}] {
  11. regexp -- {item=(.*)} $href -> item
  12. lappend items $item
  13. }
  14.  
  15. puts $items