hess-get-bills-table-indices
v1.0.0
Published
Get the current bill indices like "1-7 of 514 Natural Gas Invoices" in the header of the bills table on the Hess Energy website https://hessenergy.com
Downloads
6
Readme
Hess Get Bill Table Indices
Get the current bill indices from the text like 1-7 of 514 Natural Gas Invoices in the header of the bills table on the Hess Energy website https://hessenergy.com
Installation
npm install -S hess-get-bill-table-indices
Usage
var getIndices = require('hess-get-bills-table-indices')
var html = 'foo html here' // html of the webpage containing the a single page in table of bills for a given account
var $ = cheerio.load(html)
getIndices($, function (err, indices) {
if (err) {
console.log(err.stack)
delete err.stack
inspect(err, 'error getting bills table indices')
return
}
inspect(indices, 'bills table indices')
})
indices
in the example above looks like
var indices = {
start: 1,
end: 7
total: 514
}
Test
# install development dependencies
npm install
# run tests
npm test