A command-line tool for extracting data from web pages using CSS selectors. Nakiri can fetch content from URLs or read HTML from standard input, making it useful for web scraping and HTML parsing tasks.
shards install
crystal build src/nakiri.crnakiri -u URL -s SELECTOR [-a ATTRIBUTE]-u, --url=URL: URL to scrape (optional, reads from stdin if not provided)-s, --selector=SELECTOR: CSS selector (required)-a, --attribute=ATTR: Attribute to extract (optional)-h, --help: Show help message
Extract all links from a webpage:
nakiri -u https://example.com -s "a" -a hrefExtract all image sources:
nakiri -u https://example.com -s "img" -a srcExtract text content from specific elements:
nakiri -u https://example.com -s ".article-content p"Process HTML from stdin:
curl https://example.com | nakiri -s "h1"- Crystal >= 1.0.0
This project is open source and available under the MIT License.