User Tools

Site Tools


Sidebar



en:objects:app:captcha_dlg:dlg_captcha_from_url_exactly

dlg_captcha_from_url_exactly

dlg_captcha_from_url_exactly($src,$exactly=true,$frame=-1); - find the image with the specified src on the current page and enter it via the captcha input dialog

The function accepts parameters as input:

  • $src – src used to search for the image on the current page
  • $exactly – exact match of src
  • $frame – frame number where to search for an image

    After testing, the function returns the result of its work to the script :
  • Captcha entered – captcha entered by the user in the dialog or "false" if the captcha was not entered

    PHP example:

    <?php $xhe_host = "127.0.0.1:7119";
     
    //connect the object to control the emulator, if not already connected
    if(!isset($path))
      $path = "../../../Templates/xweb_human_emulator.php";
    require($path);
     
    //Start
    echo "<hr> <font color = blue> app->".basename(__FILE__)."</font> <hr>";
     
    $PHP_Use_Trought_Shell = false;
     
    //1
    echo "1.Go to the image polygon:";
    echo $browser->navigate("http://www.humanemulator.net/poligon/image.html")."<br>";
     
    //2
    echo "2.Get the captcha for the picture with src = http://humanemulator.net/images/captcha.jpg:";
    echo $app->dlg_captcha_from_url_exactly("http://humanemulator.net/images/captcha.jpg")."<br>";
     
    //3
    echo "3.Get the captcha for the image with src containing captcha.jpg:";
    echo $app->dlg_captcha_from_url_exactly("http://humanemulator.net/images/captcha.jpg", false)."<br>";
     
    //4
    echo "4.Get a captcha for a picture with src = http://humanemulator.net/images/captcha.jpg in a zero frame:";
    echo $app->dlg_captcha_from_url_exactly("http://humanemulator.net/images/captcha.jpg", true, 0)."<br>";
     
    //five
    echo "5.Get a captcha for a nonexistent image:";
    if(!$app->dlg_captcha_from_url_exactly("ptych.jpg", false))
    echo "no such picture";
     
    //end
    echo "<hr> <br>";
     
    //Quit
    $app->quit();
    ?>

    Python example:

    # Additional paths
    import sys
    sys.path.insert(0, '../../../Templates PY/')
     
    xhe_host = "127.0.0.1:7010"
    from xweb_human_emulator import *
     
    # Start
    echo("<hr> <font color = blue> app.xxxxxxxxx </font> <hr>")
     
    # 1
    echo("1.Go to image polygon:")
    echo(browser.navigate("http://www.humanemulator.net/poligon/image.html"), "<br>")
     
    # 2
    echo("2.Get a captcha for a picture with src = http://humanemulator.net/images/captcha.jpg:")
    echo(app.dlg_captcha_from_url_exactly("http://humanemulator.net/images/captcha.jpg"), "<br>")
     
    # 3
    echo("3.Get the captcha for the image with src containing captcha.jpg:")
    echo(app.dlg_captcha_from_url_exactly("http://humanemulator.net/images/captcha.jpg", false), "<br>")
     
    # 4
    echo("4.Get a captcha for a picture with src = http://humanemulator.net/images/captcha.jpg in a zero frame:")
    echo(app.dlg_captcha_from_url_exactly("http://humanemulator.net/images/captcha.jpg", true, 0), "<br>")
     
    # five
    echo("5.Get a captcha for a nonexistent picture:")
    if not app.dlg_captcha_from_url_exactly("ptych.jpg", false):
    echo("no such picture")
     
    # end
    echo("<hr> <br>")
     
    # Quit
    app.quit()

    C# example:

    #region using
     
    using System;
    using System.Diagnostics;
    using System.Collections.Generic;
    using System.Linq;
    using System.IO;
    using System.Text;
    using System.Threading;
     
    using XHE;
    using XHE.XHE_DOM;
    using XHE.XHE_System;
    using XHE.XHE_Window;
    using XHE.XHE_Web;
     
    #endregion
     
     class Program: XHEScript
     {
    static void Main(string [] args)
    {
    //init XHE
    server = "127.0.0.1:7010";
    InitXHE();
     
    //Start
    echo("<hr> <font color = blue> app.dlg_captcha_from_url_exactly </font> <hr>");
     
    //1 step
    echo("1.Go to the images polygon:" + browser.navigate("www.humanemulator.net/poligon/image.html") + " n");
     
    //step 2
    echo("2.Get the captcha for the picture with src = http://humanemulator.net/images/captcha.jpg:" + app.dlg_captcha_from_url_exactly("http://humanemulator.net/images/captcha.jpg") + "  n ");
     
    //step 3
    echo("3.Get a captcha for a picture with src containing captcha.jpg:" + app.dlg_captcha_from_url_exactly("http://humanemulator.net/images/captcha.jpg", false) + " n");
     
    //step 4
    echo("4.Get a captcha for a picture with src = http://humanemulator.net/images/captcha.jpg in a zero frame:" + app.dlg_captcha_from_url_exactly("http://humanemulator.net/images/captcha.jpg" , true, "0") + " n");
     
    //step 5
    echo("5.Get a captcha for a non-existent picture:" + app.dlg_captcha_from_url_exactly("ptych.jpg", false));
     
    //end
    echo("<hr> <br>");
     
    app.quit();
    }
    }

    Java Script example:

    //connect the object to control the emulator, if not already connected
    xhe_host = "127.0.0.1:7010";
    echo = require("../../../Templates JS/xweb_human_emulator.js");
     
    //Start
    echo("<hr> <font color = blue> app.dlg_captcha_from_url_exactly </font> <hr>");
     
    //1 step
    echo("1.Go to the image polygon:");
    echo(browser.navigate("http://www.humanemulator.net/poligon/image.html") + "<br>");
     
    //step 2
    echo("2.Get a captcha for a picture with src = http://humanemulator.net/images/captcha.jpg:");
    echo(app.dlg_captcha_from_url_exactly("http://humanemulator.net/images/captcha.jpg") + "<br>");
     
    //step 3
    echo("3.Get the captcha for the image with src containing captcha.jpg:");
    echo(app.dlg_captcha_from_url_exactly("http://humanemulator.net/images/captcha.jpg", false) + "<br>");
     
    //step 4
    echo("4.Get a captcha for a picture with src = http://humanemulator.net/images/captcha.jpg in a zero frame:");
    echo(app.dlg_captcha_from_url_exactly("http://humanemulator.net/images/captcha.jpg", true, 0) + "<br>");
     
    //step 5
    echo("5.Get a captcha for a nonexistent picture:");
    if(!app.dlg_captcha_from_url_exactly("ptych.jpg", false))
    echo("there is no such picture");
     
    //end
    echo("<hr> <br>");
     
    //Quit
    app.quit();
  • en/objects/app/captcha_dlg/dlg_captcha_from_url_exactly.txt · Last modified: 2026/08/05 22:31 (external edit)