Download the PHP package weidner/goutte without Composer
On this page you can find all versions of the php package weidner/goutte. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download weidner/goutte
More information about weidner/goutte
Files in weidner/goutte
Package goutte
Short Description Laravel Facade for Goutte, a simple PHP Web Scraper
License MIT
Homepage https://github.com/dweidner/laravel-goutte
Informations about the package goutte
Laravel Facade for Goutte
This repository implements a simple ServiceProvider that makes a singleton instance of the Goutte client easily accessible via a Facade in Laravel. See @FriendsOfPHP/Goutte for more information about the PHP web scraper and its interfaces.
[!WARNING]
Goutte is deprecated and suggests to use theHttpBrowser
class from the Symfony BrowserKit component as a direct repacement. This package was developed as a simple integration for Laravel applications and thus will be deprecated as well.
Installation using Composer
In your terminal application move to the root directory of your laravel project using the cd
command and require the project as a dependency using composer.
This will add the following lines to your composer.json
and download the project and its dependencies to your projects ./vendor
directory:
Usage
In order to use the static interface we first have to customize the application configuration to tell the system where it can find the new service. Open the file config/app.php
in the editor of your choice and add the following lines ([1]
, [2]
):
Now you should be able to use the facade within your application. Laravel will autoload the corresponding classes once you use the registered alias.
TIP: If you retrieve a "Class 'Goutte' not found"-Exception try to update the autoloader by running composer dump-autoload
in your project root.
TIP: You can use the package with Lumen as well. Register the GoutteServiceProvider
in bootstrap/app.php
and provide the missing path to your configuration directory in your AppServiceProvider
(ref #34).
Configuration
You can customize the default request options to apply to each request of the client. Copy the default configuration to your application directory first:
Open the created file in the config/goutte.php
and customize the configuration options to your liking.
Have a look into the Symfony Http Client Documentation for a full list of available options.
Version Constraint
Release | Supported Versions |
---|---|
Laravel Goutte 2.3 | Laravel 8/9/10 |
Laravel Goutte 2.2 | Laravel 8/9 |
Laravel Goutte 2.0 | Laravel 8 |
Laravel Goutte 1.6 | Laravel 5/6/7 |