0

I'm using selenium and want get a web element(captcha image) screenshot from this website.

https://www.qrcargo.com/trackshipment?docNumber=&docType=MAWB&docPrefix=157

Normally i tried many of code of getting web element screenshot but always getting wrong screenshot. (Just image sizes are correct)

I'm using latest browser drivers and browser versions.

Examples :

C# Cropping image return wrong coordinates

Getting OutofMemory error while cropping image

Work of Wrong Result:

Image of Wrong Result

How can i crop captcha from a website ? Can anyone help me please?

  • Why are you even trying to crop an entire screenshot? A quick inspection of the site shows that the captcha is in a pretty easy to grab `` element with a `src` that points you directly to the image being used as captcha. – tnw Aug 12 '21 at 22:18
  • I can get from this website, but sometimes some websites changing captcha when i call src , that time i am getting different image of captcha :( – Emre Özgürüoğlu Aug 12 '21 at 22:21
  • If you see it in a page, then it has been cached. Take it from the Browser cache. – Jimi Aug 13 '21 at 00:16
  • There should be a cdp way to screenshot an element (chrome only) – pguardiario Aug 13 '21 at 05:31
  • https://stackoverflow.com/questions/18424624/using-selenium-to-save-images-from-page/48871283 Got solution like this for this web page, i will try for another web pages, thanks all. – Emre Özgürüoğlu Aug 13 '21 at 06:01

0 Answers0