PHP Classes

PHP Scrape HTML: Retrieve and extract data from remote sites

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 370 All time: 6,811 This week: 524Up
Version License PHP version Categories
scrape 1.0.1MIT/X Consortium ...5PHP 5, Text processing, Web services


This class retrieve and extract data from remote sites.

It can send a HTTP request to retrieve data from a remote site or use a given string from a local file.

The class can extract text that is contained between a given prefix or suffix strings.

The search for the strings can be made from the retrieved data start or end.

Picture of Matthew Boyle
  Performance   Level  
Name: Matthew Boyle <contact>
Classes: 6 packages by
Country: United States United States
Age: ???
All time rank: 1963275 in United States United States
Week rank: 280 Up28 in United States United States Up
Innovation award
Innovation award
Nominee: 3x



include( 'scrape.class.php' );

$info = new Scrape('');
$rows = $info->split('techHover',0,1);

$rows as $row ){
$zip = $info->extractText($row, '.asp">');

// some string manipulation to get what you want
$cty = $info->extractText( substr($row, strpos($row, '/county')), '.asp">' );

"ZIP Code: {$zip} is in the county of {$cty}<br />\r\n";


  Files folder image Files  
File Role Description
Accessible without login Plain text file example.php Example Sample usage
Plain text file scrape.class.php Class Class source

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:6,811
This week:524Up