dev-master
9999999-dev https://github.com/Omarito2412/SeerA PHP XPath based web scraping framework
MIT
The Requires
- php >=5.3.0
by Omar Essam
curl framework xpath web scrape
Wallogit.com
2017 © Pedro Peláez
A PHP XPath based web scraping framework
A PHP XPath based web scraping framework., (*1)
Using Git, (*2)
$ git clone https://github.com/Omarito2412/Seer.git
Using Composer, (*3)
{
"require":{
"seer/seer" : "dev-master"
}
}
Or download it manually, (*4)
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');
MIT, (*6)
A PHP XPath based web scraping framework
MIT
curl framework xpath web scrape