Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

3 Commits

Repository files navigation

ReactPHP QueryList

This library brought ReactPHP and QueryList together.

Installation

composer require ahmard/reactphp-querylist

Usage

  • Playing with QueryList(scraping)
useReactphpQuerylist\Client;
useReactphpQuerylist\Queryable;
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
useReactphpQuerylist\Client;
useReactphpQuerylist\Queryable;
require'vendor/autoload.php';
Client::get('https://google.com')
->then(function (Queryable$queryable){
var_dump($queryable->response()->getReasonPhrase());
})
->otherwise(function ($error){
echo$error;
});

About

This library brought ReactPHP and QueryList together

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages