Login   Register  
PHP Classes
elePHPant
Icontem

File: ExampleCrawlLink.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Md. Shaiful islam  >  Crawler  >  ExampleCrawlLink.php  >  Download  
File: ExampleCrawlLink.php
Role: Example script
Content type: text/plain
Description: Crawl links form http://www.phpclasses.org/ site
Class: Crawler
Extract links and images from remote Web pages
Author: By
Last change:
Date: 2008-03-09 19:50
Size: 767 bytes
 

Contents

Class file image Download
<?php
include("Crawler.php");
$mycrawler=new Crawler();
$url='http://www.phpclasses.org/';
$link=$mycrawler->crawlLinks($url);

//print the result

echo "<table width=\"100%\" border=\"1\">
  <tr>
    <td width=\"30%\"><div align=\"center\"><b>Link Text </b></div></td>
    <td width=\"30%\"><div align=\"center\"><b>Link</b></div></td>
    <td width=\"40%\"><div align=\"center\"><b>Text with Link</b> </div></td>
  </tr>"
;
for(
$i=0;$i<sizeof($link['link']);$i++)
{
echo 
"<tr>
    <td><div align=\"center\">"
.$link['text'][$i]."</div></td>
    <td><div align=\"center\">"
.$link['link'][$i]."</div></td>
    <td><div align=\"center\"><a href=\""
.$link['link'][$i]."\">".$link['text'][$i]."</a></div></td>
  </tr>"
;        
        
}  
echo 
"</table>";
?>