PHP example:
<?php $xhe_host = "127.0.0.1:7013"; //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> anchor->".basename(__FILE__)."</font> <hr>"; //1 echo "1.Let's go to the polygon:"; echo $browser->navigate("http://humanemulator.net/poligon/anchor.html")."<br>"; //2 echo "2.Display the number of out-of-frame links:"; echo $anchor->get_count_by_attribute("href", ".net", false)."<br>"; //2 echo "2.Display the number of out-of-frame links containing numbers:"; echo $anchor->get_count_by_attribute("href", "/[0-9]/", 2)."<br>"; //3 echo "3.Output the number in the zero frame:"; echo $anchor->get_count_by_attribute("href", ".com", false, 0)."<br>"; //4 echo "4.Display the number in a nonexistent frame:"; echo $anchor->get_count_by_attribute("href", ".net", false, 100500)."<br>"; //five echo "5.Display the number of out-of-frame links(resistroneless):"; echo $app->set_params_object_search(true).""; echo $anchor->get_count_by_attribute("href", ".NET", false).""; echo $app->set_params_object_search(false).""; echo $anchor->get_count_by_attribute("href", ".NET", false)."<br>"; //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:7013" from xweb_human_emulator import * # Start echo("<hr> <font color = blue> common.get_count_by_attribute </font> <hr>") # 1 echo("1.Let's go to the polygon:") echo(browser.navigate("http://www.humanemulator.net/poligon/anchor.html"), "<br>") # 2 echo("2.Display the number of links outside the frame:") echo(anchor.get_count_by_attribute("href", ".net", false), "<br>") # 3 echo("3.Let's print the number in the zero frame:") echo(anchor.get_count_by_attribute("href", ".com", false, 0), "<br>") # 4 echo("4.Display the number in a nonexistent frame:") echo(anchor.get_count_by_attribute("href", ".net", false, 100500), "<br>") # 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:7016"; InitXHE(); //Start echo("<hr> <font color = blue> get_count </font> <hr>"); //1 echo("1.Let's go to the polygon:"); echo(browser.navigate("http://www.humanemulator.net/poligon/anchor.html") + "<br>"); //2 echo("2.Display the number of links outside the frame:"); echo(anchor.get_count_by_attribute("href", ".net", false) + "<br>"); //3 echo("3.Let's print the number in the zero frame:"); echo(anchor.get_count_by_attribute("href", ".com", false, "0") + "<br>"); //4 echo("4.Output the number in a non-existent frame:"); echo(anchor.get_count_by_attribute("href", ".net", false, "100500") + "<br>"); //end echo("<hr> <br>"); app.quit(); } }
Java Script example: