PHPScraper is a jQuery like object oriented php scraper and web automation library.
If you are familiar with jQuery syntax, it will be a breeze for you to request a page, click on a link, process selected elements together and so on. If you have questions or problems with installation or usage create an Issue.
Currently PHPScraper in in beta. If you are using composer, you must set minimum-stability to dev
. to get latest version.
It is still not ready to use in production.
If you have composer installed run command:
composer require phpscraper/phpscraper
Or if you prefer to add it manually using composer.json
add this:
"phpscraper/phpscraper": "*"
This will install the latest version (currently: v0.1.6-beta) of PHPScraper into your project.
$engine = new \PHPScraper\Engine();
$engine->get('https://www.example.com/', NULL, function( $headers, $body ) {
$body->find('a.some-link')->click(function ($headers, $body) {
echo $body;
// Do whatever you want to do
});
});
If you want to contribute, feel free to fork, update and ask for pull request. Thank you.
The source code is licensed under GPLv3.