Scrappy.js is a simple command-line web scraper.
Scrappy.js is a simple command-line web scraper.
Commands:
The tool operates via node scrappy.js <command> and offers three main commands:
url: The primary scraping command.- Parameters:
url: The target URL to scrape.--root-element: CSS selector for the parent element containing the data to be scraped.--json-object: A JSON object (created using thejsoncommand) defining the elements to scrape.--time-interval: (Optional) Scrapes in a loop with a given time interval.--first: (Optional) Returns the firstnnumber of elements.--help: Displays help for theurlcommand.
- Parameters:
json: An interactive command to help users create the JSON object required by theurlcommand. It prompts for:field: Name of the scraped tag.selector: jQuery selector for the tag.type: Specifies whether to gettextor anattr(attribute) value.attr_selector: (Required iftypeisattr) The specific attribute to scrape.- Users can quit the interactive prompt by entering
qat any time.
help: Prints the general help text for Scrappy.js.