File size: 679 Bytes
237ef97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from abc import ABC, abstractmethod

from src.models.scrape_models import ScrapeQuery, ScrapeResult


class ScraperInterface(ABC):
    @abstractmethod
    def get_url_content(url_parameters: ScrapeQuery) -> ScrapeResult:
        """
        Fetches the content of the specified URL and returns the result as a ScrapeResult object.
        Args:
            url_parameters (ScrapeQuery): The URL parameters to fetch content from.
        Returns:
            ScrapeResult: An object containing the scraped content and related metadata.
        Raises:
            NotImplementedError: This method should be implemented by subclasses.
        """
        raise NotImplementedError