2017 © Pedro Peláez
 

project seer

A PHP XPath based web scraping framework

image

seer/seer

A PHP XPath based web scraping framework

  • Sunday, July 19, 2015
  • by Omarito2412
  • Repository
  • 2 Watchers
  • 7 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

SEER

A PHP XPath based web scraping framework., (*1)

Install

Using Git, (*2)

$ git clone https://github.com/Omarito2412/Seer.git

Using Composer, (*3)

{
     "require":{
          "seer/seer" : "dev-master"
     }

}

Or download it manually, (*4)

Usage

Simply require Seer.php and start your query., (*5)

<?php

require_once 'Seer.php';


use Seer\Seer;
use Seer\Core\Output;
use Seer\Core\Curl;
use Seer\Core\Xpath;


$xpath = new Xpath;
$curl = new Curl;
$output = new Output;

$scraper = new Seer($xpath, $curl, $output);

$scraper->curl->init('https://github.com/Omarito2412/Seer');
$scraper->curl->add_option(array(
     CURLOPT_RETURNTRANSFER => true,
     CURLOPT_FOLLOWLOCATION => true
));
$page = $scraper->curl->run();
$scraper->xpath->load($page);
$scraper->xpath->add_query('Filenames', "//td[@class='content']/span/a/text()");
$Names = $scraper->xpath->run()['Filenames'];

$scraper->output->csv_init('output.csv', 'File');
$output = array();
foreach($Names as $name){
     $output[] = array($name->nodeValue);
}
$scraper->output->csv_push_all('output.csv', $output);
$scraper->output->csv_create('output.csv');

LICENSE

MIT, (*6)

The Versions

19/07 2015

dev-master

9999999-dev https://github.com/Omarito2412/Seer

A PHP XPath based web scraping framework

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

curl framework xpath web scrape