@@ -618,23 +618,26 @@ of the information you need to create a POST request for the form::
618
618
619
619
// now use some HTTP client and post using this information
620
620
621
- One great example of an integrated system that uses all of this is `Goutte `_.
622
- Goutte understands the Symfony Crawler object and can use it to submit forms
621
+ One great example of an integrated system that uses all of this is
622
+ the :class: `Symfony\\ Component\\ BrowserKit\\ HttpBrowser ` provided by
623
+ the :doc: `BrowserKit component </components/browser_kit >`.
624
+ It understands the Symfony Crawler object and can use it to submit forms
623
625
directly::
624
626
625
- use Goutte\Client;
627
+ use Symfony\Component\BrowserKit\HttpBrowser;
628
+ use Symfony\Component\HttpClient\HttpClient;
626
629
627
630
// makes a real request to an external site
628
- $client = new Client( );
629
- $crawler = $client ->request('GET', 'https://github.com/login');
631
+ $browser = new HttpBrowser(HttpClient::create() );
632
+ $crawler = $browser ->request('GET', 'https://github.com/login');
630
633
631
634
// select the form and fill in some values
632
635
$form = $crawler->selectButton('Sign in')->form();
633
636
$form['login'] = 'symfonyfan';
634
637
$form['password'] = 'anypass';
635
638
636
639
// submits the given form
637
- $crawler = $client ->submit($form);
640
+ $crawler = $browser ->submit($form);
638
641
639
642
.. _components-dom-crawler-invalid :
640
643
@@ -659,5 +662,4 @@ Learn more
659
662
* :doc: `/testing `
660
663
* :doc: `/components/css_selector `
661
664
662
- .. _`Goutte` : https://github.com/FriendsOfPHP/Goutte
663
665
.. _`html5-php library` : https://github.com/Masterminds/html5-php
0 commit comments