Scrape Table

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Example)
(Example)
Line 20: Line 20:
 
To save the table to a .csv file, simple insert the table into the [[save to file]] command.
 
To save the table to a .csv file, simple insert the table into the [[save to file]] command.
  
<pre>
 
  
 +
<pre>
 
save to file("C:\\Users\\Desktop\\mytable.csv", &my table)
 
save to file("C:\\Users\\Desktop\\mytable.csv", &my table)
 
 
</pre>
 
</pre>
 +
 +
  
 
For the example script above, browse for an .txt or .csv file you can save the table contents to.
 
For the example script above, browse for an .txt or .csv file you can save the table contents to.
  
 
Make sure your table is populated before attempting to save tot he file.
 
Make sure your table is populated before attempting to save tot he file.

Revision as of 12:21, 15 May 2013

This command is part of the Browser Command for the Professional Edition. Scrape Table scrapes an html table element into a UBot table.

Simply drag this command into the scripting area and choose an item within the table using the element selector option. (See The Selectors for more information)

Table Element: An item selected from the targeted table for scraping.

Table: The UBot table the scraped table should be saved to.

Example

navigate("http://www.w3schools.com/html/html_tables.asp", "Wait")
scrape table(<innertext="Apples">, &my table)

File:Scrapetable.png


Running the script will cause the browser to navigate to the specified website and scrape the table on the website to a ubot table.

To save the table to a .csv file, simple insert the table into the save to file command.


save to file("C:\\Users\\Desktop\\mytable.csv", &my table)


For the example script above, browse for an .txt or .csv file you can save the table contents to.

Make sure your table is populated before attempting to save tot he file.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox