humanemulator.net — справка.
Продукт, демо и покупка — на
хуманэмулятор.рф
|
Демо
|
Купить
|
API
|
лог изменений
get_cache_folder
get_cache_folder(); - получить текущую папку кэшаПосле отработки функция возвращает результат своей работы в скрипт :
Пример использования
<?php // Scenario: Get current cache folder and set custom cache folder $xhe_host = "localhost:7010"; if (!isset($path)){ // Path to the init.php file for connecting to the XHE API $path = "../../../Templates/init.php"; // Including init.php grants access to all classes and functionality for working with the XHE API require($path); } // The following code demonstrates the usage of the get_cache_folder function // Get current cache folder $cache_folder = WEB::$browser->get_cache_folder(); echo "Current cache folder: " . $cache_folder; // Navigate to a website to generate some cache $url = "https://www.google.com"; WEB::$browser->navigate($url); WEB::$browser->wait(3); echo "\n\nNavigated to: " . $url; echo "\nCache should be saved to: " . $cache_folder; // Set a custom cache folder $custom_folder = "./my_cache"; $result = WEB::$browser->set_cache_folder($custom_folder); if ($result) { echo "\n\nSuccessfully set cache folder to: " . $custom_folder; // Verify the change $updated_folder = WEB::$browser->get_cache_folder(); echo "\nUpdated cache folder: " . $updated_folder; // Navigate again to test the new folder WEB::$browser->navigate($url); WEB::$browser->wait(3); echo "\n\nNavigated again to: " . $url; echo "\nCache should now be saved to: " . $updated_folder; } else { echo "\n\nFailed to set cache folder"; } // Reset to default cache folder WEB::$browser->set_cache_folder(""); $default_folder = WEB::$browser->get_cache_folder(); echo "\n\nReset to default cache folder: " . $default_folder; // Quit the application WINDOW::$app->quit(); ?>
# Additional paths import sys sys.path.insert(0, '../../../Templates PY/') xhe_host = "127.0.0.1:7013" from xweb_human_emulator import * # начало echo("<hr><font color=blue>browser.xxxxxxxxx</font><hr>") # 1 echo("1. Получим папку кэша : ") echo(browser.get_cache_folder(),"\n") # конец echo("<hr><br>") # Quit app.quit()
#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 = "localhost:7010"; InitXHE(); // начало echo("<hr><font color=blue>browser.get_cache_folder</font><hr>"); // 1 шаг echo("1. Получим папку с текущим кэшем : "); echo(browser.get_cache_folder()); // конец echo("\n\n"); app.quit(); } }
// подключим функциональные объекты, если еще не подключен xhe_host="127.0.0.1:7010"; echo=require("../../../Templates JS/init.js"); // начало echo("<hr><font color=blue>browser.get_cache_folder</font><hr>"); // 1 шаг echo("1. Получим папку кэша : "); echo(browser.get_cache_folder()+"\n"); // конец echo("\n"); // Quit app.quit();
=============================================
Browser Объекты DOM System Vision Web Window
=============================================
если что-то непонятно или необходимо узнать или считаете что надо добавить по работе этой функции, пишите в комментарии или на наш форум
.