Click-based event emulation on web page

This link goes to the implementation of the imagination captcha imagination

The authors themselves asked people to make algorithms to try their effectiveness against AI attacks.

In fact, the first page asks you to click anywhere in the image ... My problem is that my algorithm contains a dot (x, y) in the image, but I want to imitate it in real time using this link ...

Can someone tell me how I can send point values ​​to this link and return a message whether I was successful or not ....

Essentially, I ask how I can emulate a mouse click on this link at the points that my algorithm gives with C # ...

I ask about this only to study the features of this captcha and its accuracy.

Thank you so much

+5
source share
4 answers

If you can execute JavaScript on this page directly, this code will do:

submitClick(document.getElementById("img").value, x, y, "tiled");

Otherwise, click this url, replacing your own values ​​for id, xand y:

http://goldbach.cse.psu.edu/s/captcha/captcha_controller.php?id=87170&x=66&y=149&source=tiled

Analysis of the answer - if your coordinates are correct, the answer will contain "step 2". If not, the answer will contain "step 1" and it will have <div id="error">.

+8
source

, , . HTML Agility Pack ( nuget). DOM , .

+3

, , , Selenium Browser add- , / ' .

, . , , .

+2

WebAii in telerik has this feature. Here is an example of the code that I used at some point in the past, customized for your situation. just put this in the class leaving the container of the class because it calls formatting

protected static Manager _manager = null;
    protected static Manager _manager = null;
    protected Browser _main;
    protected Find _find;
public WebAiiAutomater() 
{
    if (_manager != null)
    {
        foreach (var broswer in _manager.Browsers)
        {
            broswer.Close();

        }
        return;
    }

    var settings = new Settings(BrowserType.InternetExplorer, @"c:\log\") { ClientReadyTimeout = 60 * 1000 };

    _manager = new Manager(settings);
    _manager.Start();
    _manager.LaunchNewBrowser();
    _manager.ActiveBrowser.AutoWaitUntilReady = true;

    _main = _manager.ActiveBrowser;
    _find = _main.Find;
    _main.NavigateTo(@"http://goldbach.cse.psu.edu/s/captcha/");
    //start looping over your alogrithm trying different x,y coords against ClickImage(x,y
}

public bool ClickImage(int x, int y)
{
    //var beginsearch = _find.ById("captcha_img"); //this should get you the image, but you don't need
    _manager.Desktop.Mouse.Click(MouseClickType.LeftClick, x, y);
    Thread.sleep(1000); //wait for postback - might be handled internally though
    var errordiv = _find.ById("error");

    return errordiv !=null;
}
+1
source

All Articles