@@ -581,23 +581,26 @@ of the information you need to create a POST request for the form::
581
581
582
582
// now use some HTTP client and post using this information
583
583
584
- One great example of an integrated system that uses all of this is `Goutte `_.
585
- Goutte understands the Symfony Crawler object and can use it to submit forms
584
+ One great example of an integrated system that uses all of this is
585
+ the :class: `Symfony\\ Component\\ BrowserKit\\ HttpBrowser ` provided by
586
+ the :doc: `BrowserKit component </components/browser_kit >`.
587
+ It understands the Symfony Crawler object and can use it to submit forms
586
588
directly::
587
589
588
- use Goutte\Client;
590
+ use Symfony\Component\BrowserKit\HttpBrowser;
591
+ use Symfony\Component\HttpClient\HttpClient;
589
592
590
593
// makes a real request to an external site
591
- $client = new Client( );
592
- $crawler = $client ->request('GET', 'https://github.com/login');
594
+ $browser = new HttpBrowser(HttpClient::create() );
595
+ $crawler = $browser ->request('GET', 'https://github.com/login');
593
596
594
597
// select the form and fill in some values
595
598
$form = $crawler->selectButton('Sign in')->form();
596
599
$form['login'] = 'symfonyfan';
597
600
$form['password'] = 'anypass';
598
601
599
602
// submits the given form
600
- $crawler = $client ->submit($form);
603
+ $crawler = $browser ->submit($form);
601
604
602
605
.. _components-dom-crawler-invalid :
603
606
@@ -622,5 +625,4 @@ Learn more
622
625
* :doc: `/testing `
623
626
* :doc: `/components/css_selector `
624
627
625
- .. _`Goutte` : https://github.com/FriendsOfPHP/Goutte
626
628
.. _`html5-php library` : https://github.com/Masterminds/html5-php
0 commit comments