load_profile

load_profile($path); - load all browser profile settings from the profile file.(Available from version 7.0.12)

the Function accepts parameters as input:

  • $path – path to the file to load the profile

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

    PHP example: browser->".basename(__FILE__)."
    "; //1 step echo "1.Let's set the browser parameters:"; echo $browser->set_user_agent("5Googlebot/2.1(+ http://www.google.com/bot.html)").""; echo $browser->set_screen_resolution(1024,768,16).""; echo $browser->set_language("en")." n"; //step 2 echo "2.Let's see the parameters:"; echo $browser->navigate("whoer.net/extended")." n"; //step 3 echo "2.Save the profile:"; echo $browser->save_profile("active_page_profile.json")." n"; //step 4 echo "4.Add a bookmark:"; echo $browser->add_tab()." n"; //step 5 echo "5.Install the same profile on it:"; echo $browser->load_profile("active_page_profile.json")." n"; //step 6 echo "6.Let's see the parameters:"; echo $browser->navigate("whoer.net/extended")." n"; //end echo "

    "; //Quit $app->quit(); ?>
    Python example: # Additional paths import sys sys.path.insert(0, '../../../Templates PY/') xhe_host = "127.0.0.1:7010" from xweb_human_emulator import * # Start echo("
    browser.xxxxxxxxx
    ") # 1 step echo("1.Let's set the browser parameters:"); echo(browser.set_user_agent("5Googlebot/2.1(+ http://www.google.com/bot.html)"), ""); echo(browser.set_screen_resolution(1024,768,16), ""); echo(browser.set_language("en"), " "); # 2 step echo("2.Let's see the parameters:"); echo(browser.navigate("whoer.net/extended"), " "); # 3 step echo("2.Save the profile:"); echo(browser.save_profile("active_page_profile.json"), " "); # 4 step echo("4.Add a bookmark:"); echo(browser.add_tab(), " "); # 5 step echo("5.Install the same profile on it:"); echo(browser.load_profile("active_page_profile.json"), " "); # 6 step echo("6.Let's see the parameters:"); echo(browser.navigate("whoer.net/extended"), " "); # 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:7010"; InitXHE(); //Start echo("
    browser.set_width
    "); //1 step echo("1.Let's set the browser parameters:"); echo(browser.set_user_agent("5Googlebot/2.1(+ http://www.google.com/bot.html)") + ""); echo(browser.set_screen_resolution(1024,768,16) + ""); echo(browser.set_language("en") + " n"); //step 2 echo("2.Let's see the parameters:"); echo(browser.navigate("whoer.net/extended") + " n"); //step 3 echo("2.Save the profile:"); echo(browser.save_profile("active_page_profile.json") + " n"); //step 4 echo("4.Add a bookmark:"); echo(browser.add_tab() + " n"); //step 5 echo("5.Install the same profile on it:"); echo(browser.load_profile("active_page_profile.json") + " n"); //step 6 echo("6.Let's see the parameters:"); echo(browser.navigate("whoer.net/extended") + " n"); //end echo("

    "); app.quit(); } }
    Java Script example: //connect the object to control the emulator, if not already connected xhe_host = "127.0.0.1:7010"; echo = require("../../../Templates JS/xweb_human_emulator.js"); //Start echo("
    browser.set_width
    "); //1 step echo("1.Let's set the browser parameters:"); echo(browser.set_user_agent("5Googlebot/2.1(+ http://www.google.com/bot.html)"), ""); echo(browser.set_screen_resolution(1024,768,16), ""); echo(browser.set_language("en"), " n"); //step 2 echo("2.Let's see the parameters:"); echo(browser.navigate("whoer.net/extended"), " n"); //step 3 echo("2.Save the profile:"); echo(browser.save_profile("active_page_profile.json"), " n"); //step 4 echo("4.Add a bookmark:"); echo(browser.add_tab(), " n"); //step 5 echo("5.Install the same profile on it:"); echo(browser.load_profile("active_page_profile.json"), " n"); //step 6 echo("6.Let's see the parameters:"); echo(browser.navigate("whoer.net/extended"), " n"); //end echo("

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