User Tools

Site Tools


Sidebar

en:objects:interface:get:get_numbers_child

get_numbers_child

get_numbers_child($element_type="",$include_subchildren=false); - get the numbers of elements that are children of this element in the DOM model.

The function accepts parameters as input:

  • $element_type = "" - type of element to work with. Can be anchor, div, element, etc. If the parameter is not specified, the function works with all DOM elements of the page tree.
  • $include_subchildren - search also in all child subelements. (available since version 7.0.23)

    After testing, the function returns the result of its work to the script :
  • element numbers – a string with the numbers of child elements separated by <br> (or the empty string if the element contains no child elements), the type of the return value string
  • false to find this element failed (e.g. no items that meet the specified criteria or not this frame)

    PHP example:

    <?php $xhe_host = "127.0.0.1:7014";
     
    //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> interface->".basename(__FILE__)."</font> <hr>";
     
    //1
    echo "1.Let's go to the polygon for the shape:";
    echo $browser->navigate("http://humanemulator.net/poligon/btn.html")."<br>";
     
    //2
    echo "2.Get the numbers of all elements in the form with number 0:";
    echo $form->get_by_number(0)->get_numbers_child("")." n";
     
    //3
    echo "3.Get the numbers of all elements in form with number 0(including subelements):";
    echo $form->get_by_number(0)->get_numbers_child("", true)." n";
     
    //4
    echo "4.Get numbers of all anchors in the form with number 0(including subelements):";
    echo $form->get_by_number(0)->get_numbers_child("anchor", true)." n";
     
    //five
    echo "5.Get numbers of all btn in form with number 0(including subelements):";
    echo $form->get_by_number(0)->get_numbers_child("btn", true)." n";
     
    //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:7024"
    from xweb_human_emulator import *
     
    # Start
    echo("<hr> <font color = blue> interface.xxxxxxxxx </font> <hr>")
     
    # 1
    echo("1.Let's go to the polygon:")
    echo(browser.navigate("http://www.humanemulator.net/poligon/btn.html"), "<br>")
     
    # 2
    echo("2.Get the numbers of all elements in the form with number 0:")
    echo(form.get_by_number(0) .get_numbers_child(""))
     
    # 3
    echo("
    3.Get the numbers of all elements in the form with number 0(including subelements): ")
    echo(form.get_by_number(0) .get_numbers_child("", True))
     
    # 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:7024";
    InitXHE();
     
    //Start
    echo("<hr> <font color = blue> interface.get_numbers_child </font> <hr>");
     
    //1 step
    echo("1.Let's go to the polygon for the shape:");
    echo(browser.navigate("http://www.humanemulator.net/poligon/btn.html") + "<br>");
     
    //step 2
    echo("2.Get the numbers of all elements in the form with number 0:");
    echo(form.get_by_number(0) .get_numbers_child(""));
     
    //step 3
    echo(" n3.Get the numbers of all elements in the form with number 0(including subelements):");
    echo(form.get_by_number(0) .get_numbers_child("", true));
     
    //step 4
    echo(" n4.Get anchor numbers in the form numbered 0(including subelements):");
    echo(form.get_by_number(0) .get_numbers_child("anchor", true));
     
    //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:7024";
    echo = require("../../../Templates JS/xweb_human_emulator.js");
     
    //Start
    echo("<hr> <font color = blue> interface.get_numbers_child </font> <hr>");
     
    //1 step
    echo("1.Let's go to the polygon:");
    echo(browser.navigate("http://www.humanemulator.net/poligon/btn.html") + "<br>");
     
    //step 2
    echo("2.Get the numbers of all elements in the form with number 0:");
    echo(form.get_by_number(0) .get_numbers_child(""));
     
    //step 3
    echo(" n3.Get the numbers of all elements in the form with number 0(including subelements):");
    echo(form.get_by_number(0) .get_numbers_child("", true));
     
    //end
    echo("<hr> <br>");
     
    //Quit
    app.quit();
  • en/objects/interface/get/get_numbers_child.txt · Last modified: 2026/08/05 22:45 (external edit)