▶ Sign up free for the video, slides & prompts
The lesson below is open to all. Enter your email once to unlock every video, slide deck, prompt and code example on this device.
Checking…
Mini project: fast web checker
Check hundreds of websites in seconds with asyncio.
🎬 Video version coming soon — read it now
Let's build a tool a website owner or IT admin could actually use: check hundreds of URLs in seconds for status, response time and broken links, using asyncio, httpx and a semaphore.
The code (save as checker.py)
Run it
Put one URL per line in urls.txt, such as links from your college website or your portfolio, then:
What to notice
- Semaphore: at most 20 requests at once, polite to the servers being checked
- as_completed: progress updates while the job runs
- Errors become data: a timeout is a row in the report, not a crash
- A clear User-Agent says who is checking, which is good manners for automated tools
- Dataclass and asdict turn results straight into CSV rows
Compare: 200 URLs one at a time might take 2–3 minutes; this does it in seconds.
Challenges
- Accept a sitemap URL, parse the
<loc>entries and check every page. - Retry failures once after a short delay before marking them broken.
- Add a
--concurrencyoption with argparse. - Run it every morning (cron or Task Scheduler) and email only when something breaks.
What you learned in this course
- CPU-bound vs I/O-bound, and measuring with timeit and cProfile
- Data structures and Big-O, caching with lru_cache
- Threads, processes and asyncio, and when to use each
- Async HTTP and AI calls, rate limits and resumable pipelines
Next course: Production Python. You'll test, package, serve and deploy Python like a professional team.
In one line
You built a fast, polite, concurrent URL checker that turns errors into a report, which is a real admin tool.
Share with a friend