Element Parent

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
 
$Element Parent is a [[Browser Functions|Browser Function]].
 
$Element Parent is a [[Browser Functions|Browser Function]].
  
This function returns the parent of a selected element.
+
This function returns the parent of a selected element. To understand what determines an element as the parent of another element, please see [http://www.w3schools.com/js/js_htmldom_navigation.asp JavaScript HTML DOM Navigation]
  
 
The [[The Selectors|Element Selector]] is used to select an item.
 
The [[The Selectors|Element Selector]] is used to select an item.
Line 12: Line 12:
  
 
navigate("http://www.w3schools.com/html/html_tables.asp", "Wait")
 
navigate("http://www.w3schools.com/html/html_tables.asp", "Wait")
set(#parent, $scrape attribute($element parent(<innertext="Apples">), "innertext"), "Global")
+
set(#parent, $scrape attribute($element parent(<innertext="Jill">), "innertext"), "Global")
 
+
 
</pre>
 
</pre>
  
Running the script above will return the parent of the item "44%" from the table.
+
Running the script above will return the parent of the item "Jill" from the table.
  
The parent of the item is two column row  "Apples 44%".
+
The parent of the item is a three column row with the values "Jill Smith 50".
  
 
The element parent function returns the entire row to the variable.
 
The element parent function returns the entire row to the variable.
 
 
[[File:elementparent.png]]
 

Latest revision as of 16:19, 24 December 2013

$Element Parent is a Browser Function.

This function returns the parent of a selected element. To understand what determines an element as the parent of another element, please see JavaScript HTML DOM Navigation

The Element Selector is used to select an item.

Element: The desired page element.


[edit] Example


navigate("http://www.w3schools.com/html/html_tables.asp", "Wait")
set(#parent, $scrape attribute($element parent(<innertext="Jill">), "innertext"), "Global")

Running the script above will return the parent of the item "Jill" from the table.

The parent of the item is a three column row with the values "Jill Smith 50".

The element parent function returns the entire row to the variable.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox