Introduction to writing spiders and agents
Parsing links, putting it all together
    Create & print an array containing links in "example.com" home page
$URL="http://www.example.com"; $downloaded_page = `c:\curl\curl $URL`; $link_array = inclusive_parse( $page=$downloaded_page, $start="href", $end=">", $max_span="50" ); for ($xx=0; $xx<count($link_array); $xx++) { $link_array[$xx] = clean_link($link_array[$xx]); echo "Link $xx. = $link_array[$xx]\n"; }