DataSchema.XML for HTML Tables

DataSchema.XML can be used to retrieve data held in HTML TABLE elements.

Simple Table

Data
coffee 1.25
juice 2.00
tea 1.25
soda 1.00
Schema
{
    // Each record is held in a TR
    resultListLocator: "tr",
    // Note that the XPath indexes are 1-based!
    resultFields: [{key:"beverage", locator:"td[1]"}, {key:"price", locator:"td[2]"}]
}
    
Normalized data

Complex table

Data
item price
hamburger 4.00
cheeseburger 4.50
veggie burger 4.00
salmon burger 5.00
french fries 1.50
onion rings 2.00
fruit salad 2.50
side salad 2.00
coffee 1.25
juice 2.00
tea 1.25
soda 1.00
Schema
// This schema is dynamically generated
{
    // Each record is held in a TR
    resultListLocator: "tr",
    // Note that the XPath indexes are 1-based!
    resultFields: [{key:"beverage", locator:"td[1]"}, {key:"price", locator:"td[2]"}]
}
    
Normalized data