andykais / scrape-pages

generalized scraper using a single instruction set for any site that can be statically scraped
https://scrape-pages.js.org
MIT License
6 stars 2 forks source link

config access pattern class #40

Open andykais opened 4 years ago

andykais commented 4 years ago

There is data from a config that I want to access but I feel like anyone using the library should not care about the structure of the config after creating a scraper. Data I want to access is:

depends on what I want to make the access pattern. Either:

const { start, query, info } = scrape(config, options, params)
info.getInputs()
info.getScraperNames()

or

const scraper = new Scraper(config, options, params)
await scraper.start()
scraper.query(...)
scraper.getInputs()
scraper.getScraperNames()