@@ -582,23 +582,26 @@ of the information you need to create a POST request for the form::
582582
583583 // now use some HTTP client and post using this information
584584
585- One great example of an integrated system that uses all of this is `Goutte `_.
586- Goutte understands the Symfony Crawler object and can use it to submit forms
585+ One great example of an integrated system that uses all of this is
586+ the :class: `Symfony\\ Component\\ BrowserKit\\ HttpBrowser ` provided by
587+ the :doc: `BrowserKit component </components/browser_kit >`.
588+ It understands the Symfony Crawler object and can use it to submit forms
587589directly::
588590
589- use Goutte\Client;
591+ use Symfony\Component\BrowserKit\HttpBrowser;
592+ use Symfony\Component\HttpClient\HttpClient;
590593
591594 // makes a real request to an external site
592- $client = new Client( );
593- $crawler = $client ->request('GET', 'https://github.com/login');
595+ $browser = new HttpBrowser(HttpClient::create() );
596+ $crawler = $browser ->request('GET', 'https://github.com/login');
594597
595598 // select the form and fill in some values
596599 $form = $crawler->selectButton('Sign in')->form();
597600 $form['login'] = 'symfonyfan';
598601 $form['password'] = 'anypass';
599602
600603 // submits the given form
601- $crawler = $client ->submit($form);
604+ $crawler = $browser ->submit($form);
602605
603606.. _components-dom-crawler-invalid :
604607
@@ -623,5 +626,4 @@ Learn more
623626* :doc: `/testing `
624627* :doc: `/components/css_selector `
625628
626- .. _`Goutte` : https://github.com/FriendsOfPHP/Goutte
627629.. _`html5-php library` : https://github.com/Masterminds/html5-php
0 commit comments