@@ -49,9 +49,11 @@ which are basically nodes that you can traverse easily::
4949 var_dump($domElement->nodeName);
5050 }
5151
52- Specialized :class: `Symfony\\ Component\\ DomCrawler\\ Link ` and
52+ Specialized :class: `Symfony\\ Component\\ DomCrawler\\ Link `,
53+ :class: `Symfony\\ Component\\ DomCrawler\\ Image ` and
5354:class: `Symfony\\ Component\\ DomCrawler\\ Form ` classes are useful for
54- interacting with html links and forms as you traverse through the HTML tree.
55+ interacting with html links, images and forms as you traverse through the HTML
56+ tree.
5557
5658.. note ::
5759
@@ -293,7 +295,7 @@ Links
293295~~~~~
294296
295297To find a link by name (or a clickable image by its ``alt `` attribute), use
296- the ``selectLink `` method on an existing crawler. This returns a Crawler
298+ the ``selectLink `` method on an existing crawler. This returns a `` Crawler ``
297299instance with just the selected link(s). Calling ``link() `` gives you a special
298300:class: `Symfony\\ Component\\ DomCrawler\\ Link ` object::
299301
@@ -317,6 +319,23 @@ methods to get more information about the selected link itself::
317319 page suffixed with ``#foo ``. The return from ``getUri() `` is always a full
318320 URI that you can act on.
319321
322+ Images
323+ ~~~~~~
324+
325+ To find an image by its ``alt `` attribute, use the ``selectImage `` method on an
326+ existing crawler. This returns a ``Crawler `` instance with just the selected
327+ image(s). Calling ``image() `` gives you a special
328+ :class: `Symfony\\ Component\\ DomCrawler\\ Image ` object::
329+
330+ $imagesCrawler = $crawler->selectImage('Kitten');
331+ $image = $imagesCrawler->image();
332+
333+ // or do this all at once
334+ $image = $crawler->selectImage('Kitten')->image();
335+
336+ The :class: `Symfony\\ Component\\ DomCrawler\\ Image ` object has the same
337+ ``getUri() `` method as :class: `Symfony\\ Component\\ DomCrawler\\ Link `.
338+
320339Forms
321340~~~~~
322341
0 commit comments