netherphp / browser
Lightweight web requests.
Installs: 1 104
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- netherphp/common: dev-master
- symfony/css-selector: ^6.3
- symfony/dom-crawler: ^6.3
Requires (Dev)
- dealerdirect/phpcodesniffer-composer-installer: ^1.0
- netherphp/standards: ^0.2.9
- phpunit/phpunit: ^10.3
This package is auto-updated.
Last update: 2024-11-30 02:22:07 UTC
README
Provide a light weight means of asking for remote resources, idealy with the
fewest number of error cases to consider but that has yet to be seen. Able to
fetch a remote resource using PHP's file_get_contents()
or the cURL
extension.
use Nether\Browser; $Client = Browser\Client::FromURL('https://google.com/search?q=test'); // fetching generic data without any care as to what it may be. $Text = $Client->Fetch(); // fetching data expecting the remote to be valid json. returns an array on // success or null on failure. $Data = $Client->FetchAsJSON(); // array or NULL. // fetching data expecting the remote to be valid html. returns a Document on // success or null on failure. $HTML = $Client->FetchAsHTML(); // Browser\Document or NULL.