panther icon indicating copy to clipboard operation
panther copied to clipboard

Download Image

Open thedevale opened this issue 2 years ago • 1 comments

Hi, how can I download an image using Panther, after the image has been loaded?

This image, specifically, is a Captcha, and if I reload it from the source a new image is generated, so it's mandatory for me to download the exact image that has been loaded on page load

Is this possible?

thedevale avatar Jan 13 '23 15:01 thedevale

I think you can do that by following steps:

  • get the image into your screen
  • take a screenshot with $client->takeScreenshot('screen.png');
  • use a JS script with getBoundingClientRect to get coordinates and size of the image
  • crop the screenshot to that coordinates

alexander-schranz avatar Feb 09 '23 22:02 alexander-schranz