Log

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
Line 20: Line 20:
 
<pre>
 
<pre>
 
set(#page were on,$scrape attribute(<id="hplogo">,"alt"),"Global")
 
set(#page were on,$scrape attribute(<id="hplogo">,"alt"),"Global")
log(#page were on)
+
if($comparison(#page were on,"=","Google")) {
 +
    then {
 +
        log("Webpage is Google.com")
 +
    }
 +
    else {
 +
        log("Webpage is NOT Google.com")
 +
    }
 +
}
 +
 
 
</pre>
 
</pre>
  

Revision as of 16:46, 15 February 2015

This command is a Flow Command. This command writes a message to a log file.

Log: The message that is being logged.


The log file for the log command is located in your roaming folder found here: C:\Users\YOUR WINDOWS USERNAME HERE\AppData\Roaming\UBot Studio

The log folder can be located at: C:\Users\YOUR WINDOWS USERNAME HERE\AppData\Roaming\UBot Studio\Log

Dated log .txt log files are created to log each script:


Logfiles.jpg


Each message logged is also available for viewing through the debugger.


Example

set(#page were on,$scrape attribute(<id="hplogo">,"alt"),"Global")
if($comparison(#page were on,"=","Google")) {
    then {
        log("Webpage is Google.com")
    }
    else {
        log("Webpage is NOT Google.com")
    }
}

Running the script will scrape the required element, which indicates the webpage the browser is on. Once the element is scraped, it is inserted into the log command through a variable and logged in the log file.


File:Log.jpg


Opening the log file shows the following logs to show that the browser is on the correct webpage:

2015-02-15 13:19:34 [LOG] Webpage is Google.com


File:Log0.jpg


Since the browser is not on the expected webpage and the correct element was not detected, the following message is logged on the second run:


2015-02-15 13:19:34 [LOG] Webpage is NOT Google.com
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox