from abc import abstractmethod | |
from httpx import AsyncClient | |
from pydantic import BaseModel | |
class ScrapperBackendBase(BaseModel): | |
"""Base class for a source scrapper""" | |
def content_type(self) -> str: | |
"""Type of content that this backend can scrap. Used to determine what scrap backend to use to scrap full contents.""" | |
pass | |
async def scrap(self, client: AsyncClient, id: str) -> dict: | |
pass | |