hedii/extractors
Extractor is a package that find targeted types of resources in html dom.
Maintainers
2.1.0
2018-05-18 09:53 UTC
Requires
- php: >=7.1
- symfony/css-selector: ^4.0
- symfony/dom-crawler: ^4.0
Requires (Dev)
- laravel/lumen-framework: 5.5.*
- phpunit/phpunit: ~6.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
MIT 3c7781e8eddef2e203b7d110366723ecd00d8e04
- Hedi Chaibi <contact.woop@hedichaibi.com>
This package is auto-updated.
Last update: 2026-06-18 22:49:31 UTC
README
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
