Last Updated | | Ratings | | Unique User Downloads | | Download Rankings |
2021-10-18 (5 days ago) | | Not yet rated by the users | | Total: 28 This week: 28 | | All time: 10,326 This week: 5 |
|
Description | | Author |
This package can retrieve Web pages asynchronously using ReactPHP.
It uses the ReactPHP library to send HTTP requests to retrieve Web pages from remote sites without blocking other activities, like for instance queue requests to retrieve more than one page at the same time.
The package can register callback functions to handle the success or the failure of the HTTP requests. | |
|
|
Innovation award
Nominee: 5x |
|
Details
ReactPHP QueryList
This library brought ReactPHP and QueryList
together.
Installation
composer require ahmard/reactphp-querylist
Usage
require 'vendor/autoload.php';
Client::get('https://google.com')
->then(function (Queryable $queryable){
$title = $queryable->queryList()->find('head title')->text();
var_dump($title);
})
->otherwise(function ($error){
echo $error;
});
- Working with response object
use ReactphpQuerylist\Client;
use ReactphpQuerylist\Queryable;
require 'vendor/autoload.php';
Client::get('https://google.com')
->then(function (Queryable $queryable){
var_dump($queryable->response()->getReasonPhrase());
})
->otherwise(function ($error){
echo $error;
});
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.