ScraperBox inherits from EventEmitter
Add a scraper definition from a scraperJSON file
Parameters:
Get the scraper whose url
field matches the provided URL
and return it.
If no matching scrapers are found, return null.
If multiple matching scrapers are found, return
the one with the most specific match.
If multiple scrapers are found with equally specific
matches, return the one that was added to the ScraperSet
first.
Parameters:
Compare two definitions a and b to decide which has the more specific regex. Specificity is defined as the number of non- wildcard characters in the regex. If a is more specific return 1 If b is more specific return -1 If a and b have equal specificity return 0
Create a new ScraperSet. A ScraperBox is a container for scraperJSON scrapers. ScraperBox handles loading a directory of scrapers and selecting the matching scraper for a given URL
Parameters:
(directory containing scraperJSON definitions)