User Tools

Site Tools


Sidebar



en:objects:browser:navigate:navigate

navigate

navigate($url,$use_cache=true,$use_wait=true); - go to the specified url (perform navigation)

the input Function accepts parameters:

  • $url – the address of the page in the Internet that you need to click on. In addition to regular addresses, the following are supported URI abbreviations:
        about:blank - show an empty page
        about:home - show a stratum page
        about:inprivate (IE8+) - operation mode - private
       & nbsp; & nbsp;about:tabs (IE7+) - page "quick access to frequently visited sites"
        about:noadd-ons (IE7+) - operation - no add-ons
        about:noadd-onsinfo (IE7+) page "As a browser add-ons affect viewing web pages?"
        about:desktopitemnavigationfailure to show the page "navigation on local resource has failed"
        about:navigationcanceled - show the page of "navigation canceled"
        about:navigationfailure to show the page "navigation failed"
        about:offlineinformation page "navigation to the webpage was canceled" .
        about:postnotcached page "Web page expired"
        about:securityrisk page "Your security level does not allow you to protect your computer"
  • $use_cache – whether to use cache
  • $use_wait – whether to wait for navigation to end according to waiting parameters

    After testing, the function returns the result of its work to the script :
  • true – completed successfully
  • false – failed

    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> browser->".basename(__FILE__)."</font> <hr>";
     
    //go to yahu
    echo $browser->navigate("http://yahoo.com");
     
    echo $browser->navigate("about: blank");
     
    //go to a non-existent site
    if(!$browser->navigate("http://t", false))
       echo "failed to visit the site:".$browser->get_last_navigation_error();
     
    //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> browser.xxxxxxxxx </font> <hr>")
     
    # go to yahu
    browser.navigate("http://yahoo.com")
     
    browser.navigate("about: blank")
     
    # go to yahu(longer)
    if not browser.navigate("http://tttt"):
       echo("navigation failed:" + browser.get_last_navigation_error())
     
     
    # 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:7013";
    InitXHE();
     
    //Start
    echo("<hr> <font color = blue> browser.navigate </font> <hr>");
     
    //1 step
    echo("1.Let's go to yahu:");
    echo(browser.navigate("http://yahoo.com") + "<br>");
     
    //step 2
    echo("2.Let's go to a blank page:");
    echo(browser.navigate("about: balnk") + "<br>");
     
    //step 3
    echo("3.Let's go to a non-existent site:");
    if(!browser.navigate("http://ttttt"))
                    echo("navigation failed:" + browser.get_last_navigation_error());
     
    //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:7013";
    echo = require("../../../Templates JS/xweb_human_emulator.js");
     
    //Start
    echo("<hr> <font color = blue> browser.navigate </font> <hr>");
     
    //1 step
    echo("1.Let's go to yahu:");
    echo(browser.navigate("http://yahoo.com") + "<br>");
     
    //step 2
    echo("2.Let's go to about: blank:");
    echo(browser.navigate("about: blank") + " n");
     
    //step 3
    echo("3.Let's go to a non-existent address:");
    if(!browser.navigate("http://tttt"))
       echo("navigation failed:" + browser.get_last_navigation_error());
     
     
    //end
    echo("<hr> <br>");
     
    //Quit
    app.quit();
  • en/objects/browser/navigate/navigate.txt · Last modified: 2026/08/05 22:33 (external edit)