Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Rizwan Abbas  >  PHP OLX Classifieds Scraper  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example file
Class: PHP OLX Classifieds Scraper
Extract data of classifieds published in OLX sites
Author: By
Last change:
Date: 1 year ago
Size: 621 bytes
 

Contents

Class file image Download
<?php
error_reporting
(0);
include_once(
'scraper.php');

$scraper    =    new OLXscraper;

//for single item
//$url = 'http://lahore.olx.com.pk/germany-10-pfennig-1950-old-coin-iid-508966031';

//$ret        =    $scraper->scrap_OLX($url);

$searchURL    =    "http://www.olx.com.pk/nf/search/86%2Bcorrola";


$list        =    $scraper->classifiedslist($searchURL);

//loop through each url to get details
foreach($list as $url)
{
    
//get classified details
    
$ret        =    $scraper->scrap_OLX($url);
    
    foreach(
$ret as $k=>$v)
        echo 
'<strong>'.$k.' </strong>'.$v.'<br>';
    print
"------------------------------------------<br>";
}
?>