Element Sibling

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
Line 13: Line 13:
  
 
The set command returns the numbers (800) 247-9604 and (303) 242-8116 from the page as the element siblings of the item "Sales Question".
 
The set command returns the numbers (800) 247-9604 and (303) 242-8116 from the page as the element siblings of the item "Sales Question".
 +
  
 
[[File:elementsibling.png]]
 
[[File:elementsibling.png]]
Line 21: Line 22:
 
<b>hello</b>    <b>hi</b>
 
<b>hello</b>    <b>hi</b>
 
</pre>
 
</pre>
 +
  
 
The element sibling to the first <pre><b></pre> would be a #text element, which just contains "    " which is the blank space between "hello" and "hi"
 
The element sibling to the first <pre><b></pre> would be a #text element, which just contains "    " which is the blank space between "hello" and "hi"

Revision as of 18:45, 14 April 2013

$Element Sibling is a Browser Function.

This function returns the sibling of an element. $element sibling gets the element directly next to the one matched. $element sibling can return #text elements, which can be just whitespace between two tags.

Example

navigate("http://ubotstudio.com/resources", "Wait")
set(#sales questions, $scrape attribute($element sibling($element sibling(<innertext="Sales Questions">)), "innertext"), "Global")

The set command returns the numbers (800) 247-9604 and (303) 242-8116 from the page as the element siblings of the item "Sales Question".


File:Elementsibling.png

Also for the example:

<b>hello</b>    <b>hi</b>


The element sibling to the first
<b>
would be a #text element, which just contains " " which is the blank space between "hello" and "hi"
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox