Search Page

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Example)
 
(3 intermediate revisions by one user not shown)
Line 1: Line 1:
  
This function is a [[Qualifier Functions|Qualifier Function]]. This function returns whether or not the specified text is present on the current page. This function is used inside a conditional  
+
This function is a [[Qualifier Functions|Qualifier Function]]. This function returns whether or not the specified text is present on the current page.
statement such as if/then.
+
 
 +
This function is used inside a conditional statement such as if/then.
 +
 
 +
'''Search Query:''' The word, sentence being searched for on the page. The function also accepts variables and functions such as [[$next list item]], [[$list item]], [[$random list item]], [[$previous list item]], and [[$table cell]].
  
 
== Example ==
 
== Example ==
Line 18: Line 21:
  
 
</pre>
 
</pre>
 +
  
 
The script above uses the search page function to search for the word "Sample" on the current page.  
 
The script above uses the search page function to search for the word "Sample" on the current page.  
Line 23: Line 27:
 
If the word exists on the page, the script navigates to google.com.
 
If the word exists on the page, the script navigates to google.com.
  
[[File:searchpage0.png]]
+
 
 +
[[File:qsp.jpg]]
 
   
 
   
  
Line 40: Line 45:
  
 
</pre>
 
</pre>
 +
  
 
If the word does not exist on the page, the script will navigate to ubotstudio.com/resources
 
If the word does not exist on the page, the script will navigate to ubotstudio.com/resources
Line 45: Line 51:
  
  
[[File:searchpage.png]]
+
[[File:qsp0.jpg]]

Latest revision as of 18:11, 29 September 2013

This function is a Qualifier Function. This function returns whether or not the specified text is present on the current page.

This function is used inside a conditional statement such as if/then.

Search Query: The word, sentence being searched for on the page. The function also accepts variables and functions such as $next list item, $list item, $random list item, $previous list item, and $table cell.

[edit] Example

navigate("ubotstudio.com/resources", "Wait")
wait(5)
if($search page("Sample")) {
    then {
        navigate("google.com", "Wait")
    }
    else {
        navigate("ubotstudio.com/resources", "Wait")
    }
}


The script above uses the search page function to search for the word "Sample" on the current page.

If the word exists on the page, the script navigates to google.com.


Qsp.jpg


navigate("google.com", "Wait")
wait(5)
if($search page("Sample")) {
    then {
        navigate("google.com", "Wait")
    }
    else {
        navigate("ubotstudio.com/resources", "Wait")
    }
}



If the word does not exist on the page, the script will navigate to ubotstudio.com/resources


Qsp0.jpg

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox