Extensible async scraper library for concurrent web scraping with worker pattern
Project description
FastScrapy
Lightweight async web scraper framework for concurrent scraping.
Why fastscrapy?
- Worker inheritance: Override
worker()to define your scraping logic - Pure async: Built on asyncio and aiohttp. No callbacks, no frameworks
- Minimal: ~50 lines of code. Learn it in 5 minutes
Quick Start
from fastscrapy import FastScraper
class MyScraper(FastScraper):
def __init__(self, num_pages: int):
self.remaining_pages = set(range(num_pages))
self.url = 'https://jsonplaceholder.typicode.com/posts'
# override this function
async def worker(self, worker_id: int):
while self.remaining_pages:
page = self.remaining_pages.pop()
response = await self.request(self.url, params={
'_page': page,
'_limit': 10
})
posts = await response.json()
print(f"Worker {worker_id}: page {page} has {len(posts)} posts")
scraper = MyScraper(100)
# invoke 5 worker functions asynchronously
scraper.run(num_workers=5)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fastscrapy-0.1.0.tar.gz
(14.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastscrapy-0.1.0.tar.gz.
File metadata
- Download URL: fastscrapy-0.1.0.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
978398a5c5fd9b6219b6b8e85728bdce9ba7d8e6e5929c1c3b955989915ed182
|
|
| MD5 |
2ec6c86a310635581e69e62a934f8ceb
|
|
| BLAKE2b-256 |
a41a168e4b9ae3c4efbe1d3637a8e0308a995b1ee7e16603562f25257ff0fc2f
|
File details
Details for the file fastscrapy-0.1.0-py3-none-any.whl.
File metadata
- Download URL: fastscrapy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
302210df1e6b7fa7a37a3c055fca0d400ab6beca067ff034496fbf08ea9c359f
|
|
| MD5 |
5314ba7902c88a87a7791c143d7b985e
|
|
| BLAKE2b-256 |
f54670f9a4b6fc2c19ccfa4f07ab010b059167f289d9d98a499520c3856ccff9
|