Scrape Attribute

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
Line 3: Line 3:
 
The function returns the value of a specified element on a selected element.
 
The function returns the value of a specified element on a selected element.
 
As with all other scraping, you will be scraping the data to a list or variable.
 
As with all other scraping, you will be scraping the data to a list or variable.
The [[Element Selector|The Selectors]] is used to select an item for the scrape attribute.  
+
The [[The Selectors|Element Selector]] is used to select an item for the scrape attribute.  
  
 
== Example ==
 
== Example ==

Revision as of 21:21, 14 April 2013

$Scrape Attribute is a Browser Function.

The function returns the value of a specified element on a selected element. As with all other scraping, you will be scraping the data to a list or variable. The Element Selector is used to select an item for the scrape attribute.

Example

set(#my item, $scrape attribute(<href="/files/ScriptReferences//TheSelectors.pdf">, "name"), "Global")


Running the script sets a variable named "my item". The scrape attribute scrapes the selected element by the innertext. If the innertext of the item is available on the page, the innertext is scraped to the variable, as seen in the debugger.


File:Scrapeattribute.png


add list to list(%my list, $scrape attribute(<href=w"/files/ScriptReferences/*.pdf">, "innertext"), "Delete", "Global")


This script will scrape all attributes that meet the wildcard criteria by their innertext. All scraped items are placed in a list and each one is treated as an individual list item.


File:Scrapeattribute0.png

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox