What it is
A Rust command-line tool for querying product data from iHerb using a headless browser. Designed for both AI agents and humans — clean commands, Markdown output, no API key required.
How it works
iHerb uses Cloudflare anti-bot protection, so simple HTTP requests are blocked. iHerb-cli uses a headless Chromium browser (via the Chrome DevTools Protocol) to load pages like a real user. Data extraction uses multiple strategies with automatic fallback:
- JSON-LD structured data embedded in the page
- JavaScript globals (
window.PRODUCT_DETAILS, etc.) __NEXT_DATA__— iHerb’s Next.js server-side data- DOM scraping — CSS selector-based extraction as a last resort
This layered approach keeps the tool working even when iHerb changes their page structure.
TWSC experience
Not yet tested by TWSC.
Related
Sources
The Web Scraping Wiki is compiled from the tests and research published on The Web Scraping Club, the newsletter for web scraping professionals. Subscribe to get the next article in your inbox.