Save an image with Selenium WebDriver
Using Java it really easy to save an image (for any purpose).
In this code snnipet you'll do…
- Find the image element in a certain way (I'm using cssSelector)
- Get the src attribute
- Create a java URL
- Create a BufferedImage using ImageIO java class
- Use ImageIO to save the image with a preferred image extension and a location