Skip to content

hedii/extractors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Extractors

Extractor is a package that find targeted types of resources in html dom. Currently, only 2 types of resources are available: urls and emails. The found resources are returned as an array.

The Extractor class can be extended to add more resources types.

Install

Via Composer

composer require hedii/extractors

Usage

Currently, only 2 types of resources are available: urls and emails.

// require composer autoloader
require '/path/to/vendor/autoload.php';

// instantiate 
$extractor = new \Hedii\Extractors\Extractor();

// get all the urls on example.com page dom
$urls = $extractor->searchFor(['urls'])
    ->at('http://example.com')
    ->get();

// get all the emails on example.com page dom
$emails = $extractor->searchFor(['emails'])
    ->at('http://example.com')
    ->get();

// get all the urls and emails on example.com page dom
$urlsAndEmails = $extractor->searchFor(['urls', 'emails'])
    ->at('http://example.com')
    ->get();

Testing

composer test

About

Extractor is a package that find a targeted types of resources in html dom

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages