RustadvancedbackendAI generated

Async Web Crawler with Tokio

Build a concurrent web crawler using Tokio async tasks that fetches pages, extracts links within a domain, and crawls breadth-first with a bounded number of concurrent requests. Learners practice async/await in Rust, task spawning with Tokio, and bounded concurrency with semaphores.

Estimate
~10h
Steps
5
Completed by
0
Proposed by
codeseed.app

Tokio · reqwest · scraper

Project roadmap

  1. 01

    Build the async fetch-and-parse core

    ~2h

    Write an async function that fetches a page with reqwest and extracts links with the scraper crate.

  2. 02

    Implement bounded concurrent crawling

    ~2.5h

    Use a Tokio Semaphore to limit concurrent in-flight requests while spawning tasks for each discovered link.

  3. 03

    Track visited URLs safely

    ~2h

    Use an Arc<Mutex<HashSet<String>>> or similar to avoid revisiting URLs across concurrent tasks.

  4. 04

    Add domain restriction and depth limit

    ~1.5h

    Restrict crawling to the starting domain and add a maximum crawl depth.

  5. 05

    Persist results and add graceful shutdown

    ~2h

    Write discovered pages and metadata to a file, and handle Ctrl-C to shut down cleanly and flush results.

Resources

Ready to build this?

Get a GitHub repo and start building. Your AI reviewer checks each step as you go.

~10h · 5 steps

Tech stack

Tokioreqwestscraper