Python asynchronous library for web scraping
Project description
Python async library for web scrapping
Installing
pip install aioscrapy
Usage
from aioscrapy import Client, WebClient, SingleSessionPool, Dispatcher, SimpleWorker
class CustomClient(Client[str, dict]):
def __init__(self, client: WebClient):
self._client = client
async def fetch(self, key: str) -> dict:
data = self._client.fetch(key)
# Processing data, getting result
return {"result": "some_result"}
async def main():
pool = SingleSessionPool()
dispatcher = Dispatcher(['https://start-url.example.com'])
client = CustomClient(WebClient(pool))
worker = SimpleWorker(dispatcher, client)
result = await worker.run()
return result
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
aioscrapy-0.1.2.tar.gz
(5.2 kB
view hashes)
Built Distribution
Close
Hashes for aioscrapy-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 213bf4e3b125f0d35218467328ec514bfd917513e091bac2287bf1c0a7c005f2 |
|
MD5 | c43b7167a49dad76359d2127ef052ffe |
|
BLAKE2b-256 | 705ef50c3654e45151aeb77f718375a92c8f74fa12926ad2b86f86bf0931585e |