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: interface->".basename(__FILE__)."
    "; //1 echo "1.Let's go to the polygon for the shape:"; echo $browser->navigate("http://humanemulator.net/poligon/btn.html")."
    "; //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 "

    "; //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("
    interface.xxxxxxxxx
    ") # 1 echo("1.Let's go to the polygon:") echo(browser.navigate("http://www.humanemulator.net/poligon/btn.html"), "
    ") # 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("

    ") # 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("
    interface.get_numbers_child
    "); //1 step echo("1.Let's go to the polygon for the shape:"); echo(browser.navigate("http://www.humanemulator.net/poligon/btn.html") + "
    "); //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("

    "); 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("
    interface.get_numbers_child
    "); //1 step echo("1.Let's go to the polygon:"); echo(browser.navigate("http://www.humanemulator.net/poligon/btn.html") + "
    "); //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("

    "); //Quit app.quit();