async-site-crawler
A high-performance, concurrent web crawler built in Python that recursively crawls websites and exports structured data to CSV reports.
Features
- Async/Concurrent Crawling: Uses
asyncioandaiohttpfor fast, non-blocking HTTP requests - Configurable Limits: Control max concurrent requests and total pages to crawl
- Smart URL Handling: Normalizes URLs to avoid duplicate crawls
- Same-Domain Filtering: Stays within the target website domain
- HTML Parsing: Extracts h1 tags, paragraphs, links, and images using BeautifulSoup
- CSV Export: Generates structured reports for easy analysis
- Graceful Stopping: Cancels in-flight tasks when limits are reached
- Error Handling: Handles timeouts, non-HTML content, and network failures
Installation
pip install async-site-crawler
Or with uv:
uv add async-site-crawler
Usage
Command Line
async-site-crawler https://example.com
With custom settings:
async-site-crawler https://example.com 10 50
| Argument | Description | Default |
|---|---|---|
URL |
Starting URL to crawl (required) | - |
max_concurrency |
Maximum concurrent HTTP requests | 5 |
max_pages |
Maximum number of pages to crawl | 100 |
As a Python Library
import asyncio
from async_site_crawler import crawl_site_async, write_csv_report
async def main():
page_data = await crawl_site_async(
base_url="https://example.com",
max_concurrency=5,
max_pages=20
)
write_csv_report(page_data, filename="report.csv")
asyncio.run(main())
Output
The crawler generates a report.csv file with the following columns:
- page_url: The URL of the crawled page
- h1: The main heading (h1 tag) content
- first_paragraph: Text from the first paragraph (prioritizes
<main>tag) - outgoing_link_urls: All links found on the page (semicolon-separated)
- image_urls: All image URLs found on the page (semicolon-separated)
License
This project is open source and available under the MIT License.
Author
Metadata
Release files for async-site-crawler 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| async_site_crawler-0.1.0.tar.gz | 54.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| async_site_crawler-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 62.7 kB
Release files / async_site_crawler-0.1.0.tar.gz
| Download URL | async_site_crawler-0.1.0.tar.gz |
|---|---|
| Size | 54.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
037e8a6c30255d26f42b8dbcd23356d9952f4236d63380d0dc564b0d4f06d7a1
|
|
BLAKE2b-256 checksum How to use checksums |
47872a836e3e42d6058aa9536d1dced3a5ff461e377de15e2f2946214fbd62c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Release files / async_site_crawler-0.1.0-py3-none-any.whl
| Download URL | async_site_crawler-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7b4809421c775543775452675c6ff1e0742ef0149dfd656155161ee15a8531ca
|
|
BLAKE2b-256 checksum How to use checksums |
d1c5ab7ccefc857440b0ea784566734dba59274f95604f284314196f3cfd14c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Security for async-site-crawler 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.