how to send click events to yandex smartcaptcha img


New member
Hello, i'm trying to solve captcha in yandex search ( I'm stuck at the stage of clicking on the captcha image. My click attempts don't result in marks appearing on the image.

var el = document.getElementsByClassName('AdvancedCaptcha-ImageWrapper')[0].firstChild;

var rect = el.getBoundingClientRect();
var x = rect.right - rect.left / 2;
var y = rect.bottom - / 2;

var ev = new MouseEvent('click', {
view: window,
bubbles: true,
cancelable: true,
offsetX: x,
offsetY: y


I tried target on different html elements, tried PointerEvent. Sent events are visible in the debugger, and the same events allow you to click on a button, but the events do not lead to the appearance of marks on the image.
Please any comments?


  • Screenshot_4.png
    287.5 KB · Views: 1


Hi there, Try to use this

The calculation for the x and y coordinates seems to be incorrect. The x and y values are meant to represent the coordinates where the click event will be dispatched. The current calculation takes the rect.right and rect.bottom values and subtracts half the width and half the height of the element, respectively. However, the parentheses are not correctly placed, which causes the division by 2 to only apply to rect.left and, not to the entire width and height as intended.

The corrected calculation should be:

var x = (rect.right - rect.left) / 2;
var y = (rect.bottom - / 2;

I hope it help