Module scrapfly.errors
Classes
class ApiHttpClientError (request: requests.models.Request,
response: requests.models.Response | None = None,
**kwargs)-
Expand source code
class ApiHttpClientError(HttpError): passCommon base class for all non-exit exceptions.
Ancestors
- scrapfly.errors.HttpError
- ScrapflyError
- builtins.Exception
- builtins.BaseException
Subclasses
- ApiHttpServerError
- scrapfly.errors.BadApiKeyError
- scrapfly.errors.PaymentRequired
- scrapfly.errors.TooManyRequest
class ApiHttpServerError (request: requests.models.Request,
response: requests.models.Response | None = None,
**kwargs)-
Expand source code
class ApiHttpServerError(ApiHttpClientError): passCommon base class for all non-exit exceptions.
Ancestors
- ApiHttpClientError
- scrapfly.errors.HttpError
- ScrapflyError
- builtins.Exception
- builtins.BaseException
class CrawlerError (message: str,
code: str,
http_status_code: int,
resource: str | None = None,
is_retryable: bool = False,
retry_delay: int | None = None,
retry_times: int | None = None,
documentation_url: str | None = None,
api_response: ForwardRef('ApiResponse') | None = None)-
Expand source code
class CrawlerError(ScrapflyError): """Base exception for Crawler API errors""" passBase exception for Crawler API errors
Ancestors
- ScrapflyError
- builtins.Exception
- builtins.BaseException
Subclasses
class CrawlerPromptError (message: str,
code: str,
http_status_code: int,
resource: str | None = None,
is_retryable: bool = False,
retry_delay: int | None = None,
retry_times: int | None = None,
documentation_url: str | None = None,
api_response: ForwardRef('ApiResponse') | None = None)-
Expand source code
class CrawlerPromptError(CrawlerError): """ Exception raised when ``POST /crawl/prompt`` fails. Also raised mid-stream when the server sends an ``event: error`` frame: generation can fail after tokens have already been delivered, so a caller consuming the iterator must be ready for this on any ``next()``. """ passException raised when
POST /crawl/promptfails.Also raised mid-stream when the server sends an
event: errorframe: generation can fail after tokens have already been delivered, so a caller consuming the iterator must be ready for this on anynext().Ancestors
- CrawlerError
- ScrapflyError
- builtins.Exception
- builtins.BaseException
class CrawlerRefreshError (message: str,
code: str,
http_status_code: int,
resource: str | None = None,
is_retryable: bool = False,
retry_delay: int | None = None,
retry_times: int | None = None,
documentation_url: str | None = None,
api_response: ForwardRef('ApiResponse') | None = None)-
Expand source code
class CrawlerRefreshError(CrawlerError): """ Exception raised when a crawl refresh call fails. Carries the API code, e.g. ``ERR::CRAWLER::REFRESH_NOT_ENABLED``, ``ERR::CRAWLER::REFRESH_IN_PROGRESS``, ``ERR::CRAWLER::REFRESH_INTERVAL_INVALID``. """ passException raised when a crawl refresh call fails.
Carries the API code, e.g.
ERR::CRAWLER::REFRESH_NOT_ENABLED,ERR::CRAWLER::REFRESH_IN_PROGRESS,ERR::CRAWLER::REFRESH_INTERVAL_INVALID.Ancestors
- CrawlerError
- ScrapflyError
- builtins.Exception
- builtins.BaseException
class CrawlerSearchError (message: str,
code: str,
http_status_code: int,
resource: str | None = None,
is_retryable: bool = False,
retry_delay: int | None = None,
retry_times: int | None = None,
documentation_url: str | None = None,
api_response: ForwardRef('ApiResponse') | None = None)-
Expand source code
class CrawlerSearchError(CrawlerError): """ Exception raised when ``POST /crawl/search`` cannot answer. Carries the API code, e.g. ``ERR::CRAWLER::SEARCH_NOT_ENABLED``, ``ERR::CRAWLER::SEARCH_NOT_READY``, ``ERR::CRAWLER::SEARCH_TOO_MANY_CRAWLS``. A crawl that is merely skipped is *not* an error: it is reported in ``CrawlerSearchResponse.skipped`` and the search still answers. """ passException raised when
POST /crawl/searchcannot answer.Carries the API code, e.g.
ERR::CRAWLER::SEARCH_NOT_ENABLED,ERR::CRAWLER::SEARCH_NOT_READY,ERR::CRAWLER::SEARCH_TOO_MANY_CRAWLS. A crawl that is merely skipped is not an error: it is reported inCrawlerSearchResponse.skippedand the search still answers.Ancestors
- CrawlerError
- ScrapflyError
- builtins.Exception
- builtins.BaseException
class EncoderError (content: str)-
Expand source code
class EncoderError(BaseException): def __init__(self, content:str): self.content = content super().__init__() def __str__(self) -> str: return self.content def __repr__(self): return "Invalid payload: %s" % self.contentCommon base class for all exceptions
Ancestors
- builtins.BaseException
class ScrapflyAspError (request: requests.models.Request,
response: requests.models.Response | None = None,
**kwargs)-
Expand source code
class ScrapflyAspError(ScraperAPIError): passCommon base class for all non-exit exceptions.
Ancestors
- scrapfly.errors.ScraperAPIError
- scrapfly.errors.HttpError
- ScrapflyError
- builtins.Exception
- builtins.BaseException
class ScrapflyUnblockerError (request: requests.models.Request,
response: requests.models.Response | None = None,
**kwargs)-
Expand source code
class ScrapflyAspError(ScraperAPIError): passCommon base class for all non-exit exceptions.
Ancestors
- scrapfly.errors.ScraperAPIError
- scrapfly.errors.HttpError
- ScrapflyError
- builtins.Exception
- builtins.BaseException
class ScrapflyCrawlerError (message: str,
code: str,
http_status_code: int,
resource: str | None = None,
is_retryable: bool = False,
retry_delay: int | None = None,
retry_times: int | None = None,
documentation_url: str | None = None,
api_response: ForwardRef('ApiResponse') | None = None)-
Expand source code
class ScrapflyCrawlerError(CrawlerError): """Exception raised when a crawler job fails or is cancelled""" passException raised when a crawler job fails or is cancelled
Ancestors
- CrawlerError
- ScrapflyError
- builtins.Exception
- builtins.BaseException
class ScrapflyError (message: str,
code: str,
http_status_code: int,
resource: str | None = None,
is_retryable: bool = False,
retry_delay: int | None = None,
retry_times: int | None = None,
documentation_url: str | None = None,
api_response: ForwardRef('ApiResponse') | None = None)-
Expand source code
class ScrapflyError(Exception): KIND_HTTP_BAD_RESPONSE = 'HTTP_BAD_RESPONSE' KIND_SCRAPFLY_ERROR = 'SCRAPFLY_ERROR' RESOURCE_PROXY = 'PROXY' RESOURCE_THROTTLE = 'THROTTLE' RESOURCE_SCRAPE = 'SCRAPE' RESOURCE_ASP = 'ASP' RESOURCE_SCHEDULE = 'SCHEDULE' RESOURCE_WEBHOOK = 'WEBHOOK' RESOURCE_SESSION = 'SESSION' def __init__( self, message: str, code: str, http_status_code: int, resource: Optional[str]=None, is_retryable: bool = False, retry_delay: Optional[int] = None, retry_times: Optional[int] = None, documentation_url: Optional[str] = None, api_response: Optional['ApiResponse'] = None ): self.message = message self.code = code self.retry_delay = retry_delay self.retry_times = retry_times self.resource = resource self.is_retryable = is_retryable self.documentation_url = documentation_url self.api_response = api_response self.http_status_code = http_status_code super().__init__(self.message, str(self.code)) def __str__(self): message = self.message if self.documentation_url is not None: message += '. Learn more: %s' % self.documentation_url return messageCommon base class for all non-exit exceptions.
Ancestors
- builtins.Exception
- builtins.BaseException
Subclasses
- CrawlerError
- scrapfly.errors.ExtraUsageForbidden
- scrapfly.errors.HttpError
Class variables
var KIND_HTTP_BAD_RESPONSEvar KIND_SCRAPFLY_ERRORvar RESOURCE_ASPvar RESOURCE_PROXYvar RESOURCE_SCHEDULEvar RESOURCE_SCRAPEvar RESOURCE_SESSIONvar RESOURCE_THROTTLEvar RESOURCE_WEBHOOK
class ScrapflyProxyError (request: requests.models.Request,
response: requests.models.Response | None = None,
**kwargs)-
Expand source code
class ScrapflyProxyError(ScraperAPIError): passCommon base class for all non-exit exceptions.
Ancestors
- scrapfly.errors.ScraperAPIError
- scrapfly.errors.HttpError
- ScrapflyError
- builtins.Exception
- builtins.BaseException
class ScrapflyScheduleError (request: requests.models.Request,
response: requests.models.Response | None = None,
**kwargs)-
Expand source code
class ScrapflyScheduleError(ScraperAPIError): passCommon base class for all non-exit exceptions.
Ancestors
- scrapfly.errors.ScraperAPIError
- scrapfly.errors.HttpError
- ScrapflyError
- builtins.Exception
- builtins.BaseException
class ScrapflyScrapeError (request: requests.models.Request,
response: requests.models.Response | None = None,
**kwargs)-
Expand source code
class ScrapflyScrapeError(ScraperAPIError): passCommon base class for all non-exit exceptions.
Ancestors
- scrapfly.errors.ScraperAPIError
- scrapfly.errors.HttpError
- ScrapflyError
- builtins.Exception
- builtins.BaseException
class ScrapflySessionError (request: requests.models.Request,
response: requests.models.Response | None = None,
**kwargs)-
Expand source code
class ScrapflySessionError(ScraperAPIError): passCommon base class for all non-exit exceptions.
Ancestors
- scrapfly.errors.ScraperAPIError
- scrapfly.errors.HttpError
- ScrapflyError
- builtins.Exception
- builtins.BaseException
class ScrapflyThrottleError (request: requests.models.Request,
response: requests.models.Response | None = None,
**kwargs)-
Expand source code
class ScrapflyThrottleError(ScraperAPIError): passCommon base class for all non-exit exceptions.
Ancestors
- scrapfly.errors.ScraperAPIError
- scrapfly.errors.HttpError
- ScrapflyError
- builtins.Exception
- builtins.BaseException
class ScrapflyWebhookError (request: requests.models.Request,
response: requests.models.Response | None = None,
**kwargs)-
Expand source code
class ScrapflyWebhookError(ScraperAPIError): passCommon base class for all non-exit exceptions.
Ancestors
- scrapfly.errors.ScraperAPIError
- scrapfly.errors.HttpError
- ScrapflyError
- builtins.Exception
- builtins.BaseException
class UpstreamHttpClientError (request: requests.models.Request,
response: requests.models.Response | None = None,
**kwargs)-
Expand source code
class UpstreamHttpClientError(UpstreamHttpError): passCommon base class for all non-exit exceptions.
Ancestors
- scrapfly.errors.UpstreamHttpError
- scrapfly.errors.HttpError
- ScrapflyError
- builtins.Exception
- builtins.BaseException
Subclasses
class UpstreamHttpServerError (request: requests.models.Request,
response: requests.models.Response | None = None,
**kwargs)-
Expand source code
class UpstreamHttpServerError(UpstreamHttpClientError): passCommon base class for all non-exit exceptions.
Ancestors
- UpstreamHttpClientError
- scrapfly.errors.UpstreamHttpError
- scrapfly.errors.HttpError
- ScrapflyError
- builtins.Exception
- builtins.BaseException