1.0.1 • Published 3 years ago

html-text-scout v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Scout

Description

Finds text on an HTML page via relationship to other text on the page.

Example Usage

Find text on page

Hello World

const scout = await Scout.create(testHtml);

 // returns true
const found = scout.find('Hello World');

// returns ['Hello World', 'World']
const foundWithRegex = scout.find(/^Hello (\w+)$/); 

Find text under a reference text

const scout = await Scout.create(testHtml);

// returns '$8.97'
const text = scout.under('Total:' /* string or regex */);

Get row text

You can can also use scout to fetch table text

const scout = await Scout.create(testHtml);

// returns [['Book', '$20.22'], ['Coffee', '$5.99']]
const rows = scout.rowsBetween('Item', 'Total', 2);