knyga / webextractor
Extracting data from web page with different extractors like css, xpath, regex...
Installs: 27
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 3
Forks: 2
Open Issues: 0
Type:application
Requires
- php: >= 5.4
- diggin/diggin-bridge-guzzle-autocharsetencodingplugin: dev-master
- diggin/diggin-http-charset: dev-master
- fabpot/goutte: 1.0.*
- knyga/dotconfig: 1.0.*@dev
- symfony/event-dispatcher: 2.4.*
- tedivm/stash: 0.11.*
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2020-01-10 14:59:31 UTC
README
Extracting data from web page with different extractors like css, xpath, regex...
Example
Code:
<?php use WebExtractor\DataExtractor\DataExtractorFactory; use WebExtractor\DataExtractor\DataExtractorTypes; use WebExtractor\Client\Client; $factory = DataExtractorFactory::getFactory(); $extractor = $factory->createDataExtractor(DataExtractorTypes::CSS); $client = new Client; $content = $client->get('https://en.wikipedia.org/wiki/2014_Winter_Olympics'); $extractor->setContent($content); $h1 = $extractor->setSelector('h1')->extract();
For more look tests.
Installation via Composer
-
Install Composer to your project root:
curl -sS https://getcomposer.org/installer | php
-
Add a
composer.json
file to your project:{ "require": { "knyga/webextractor": "1.1.2.*@dev" } }
-
Run the Composer installer:
php composer.phar install
License
WebExtractor is licensed under the MIT license.
Oleksandr Knyga oleksandrknyga@gmail.com
Sobit Akhmedov sobit.akhmedov@gmail.com