Skip to content

faizanayubi/WebScrapping

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebScrapping

A PHP Script for scrapping website with Object Oriented Way, The main Technology used is CURL. the example below shows step by step instructions to scrape Amazon

WebScrapping

Example: Scrapping Amazon Products

  1. include the class
require_once('class.scrape.php');
  1. Create a Instance of Scrape class by providing the url you want to scrape
$amazon = new Scrape('http://www.amazon.in/gp/product/B00OZN0FI0/');
  1. Getting Product Title
$amazon->title = $amazon->xPathObj->query('//h1')->item(0)->nodeValue;

The methods function and defination is commented in class

  1. Getting Product Price
$amazon->price = $amazon->xPathObj->query('//span[@id="priceblock_saleprice"]')->item(0)->nodeValue;

Result

WebScrapping

About

A PHP Script for scrapping website with OOPs Way

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages