Scrape Table

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
Line 22: Line 22:
  
  
[[File:scrapetable.jpg]]
+
[[File:scrapt.jpg]]
  
  

Revision as of 16:08, 22 October 2014

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

To scrape a table, select an item from the table with the scrape table command.

In this example, the cell containing the value First Name in the table on the web page is selected.


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


Scrapt.jpg


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\\Documents\\mytable.csv", &my table)


Scrapetable0.jpg


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 to the file.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox