add_child

add_child($tag,$inner_html); - add a child DOM element to the element and get its DOM interface (available from version 4.9.26)

the input Function accepts parameters:

  • $tag – tag of the element to add.
  • $inner_html – internal html of the added element

    After testing, the function returns the result of its work to the script :
  • DOM element interface – an object that allows you to quickly perform any operations with the found element, the return value type XHEInterface

    PHP example: interface->".basename(__FILE__)."
    "; //to make it faster $browser->set_wait_params(5,1); //1 echo "1.Let's go to the polygon:"; echo $browser->navigate("http://humanemulator.net/poligon/anchor.html")."
    "; //3 echo "2.Add anchor to the body:"; echo $body->get_by_number(0)->add_child("a", " Ya.ru "); //3 echo " n3.Add a div to the body:"; echo $body->get_by_number(0)->add_child("div", " Ya.ru n Google.ru "); //echo $browser->run_java_script("console.log('a')", "js \ 1.js")."
    "; //end echo "

    "; //Quit $app->quit(); ?>
    Python example: # Additional paths import sys sys.path.insert(0, '../../../Templates PY/') xhe_host = "127.0.0.1:7029" from xweb_human_emulator import * # Start echo("
    interface.xxxxxxxxx
    ") # to make it faster browser.set_wait_params(5,1) # 1 echo("1.Let's go to the polygon:") echo(browser.navigate("http://www.humanemulator.net/poligon/anchor.html"), "
    ") # 3 echo("3.Add anchor to body:") echo(body.get_by_number(0) .add_child("div", "