TL;DR: Elixir scrapes the web with Req for HTTP, Floki for CSS-selector parsing, and Task.async_stream for concurrency. This guide builds a scraper that crawls a 1,000-book practice catalog into CSV and JSON, shows when the Crawly framework is worth it, and handles pages that render their content with JavaScript.Elixir web scraping comes down to three pieces: Req fetches the page, Floki parses the HTML with CSS selectors, and Task.async_stream fetches many pages at once with limits you control. In this guide, you'll build one scraper end to end. It collects every book from books.toscrape.com, a public practice catalog, follows the pagination, runs pages concurrently, retries failed requests politely, and writes the results to CSV and JSON. Then you'll scrape a JavaScript-rendered page (quotes.toscrape.com/js/) by reading its embedded JSON, by rendering it in headless Chrome, and by calling a scraping API from the same Req code.
The code targets the package versions in the table below, including the Floki 0.38 change that quietly breaks many older tutorials.




