elm.web.file_loader.AsyncFetchWithRetry

class AsyncFetchWithRetry(header_template=None, verify_ssl=True, aget_kwargs=None, client_kwargs=None)[source]

Bases: object

Loader for fetching content from the web with retry attempts

Parameters:
  • header_template (dict, optional) – Optional GET header template. If not specified, uses DEFAULT_HEADERS. By default, None.

  • verify_ssl (bool, optional) – Option to use aiohttp’s default SSL check. If False, SSL certificate validation is skipped. By default, True.

  • aget_kwargs (dict, optional) – Other kwargs to pass to aiohttp.ClientSession.get(). By default, None.

Methods

fetch(url)

Fetch content from the web

async fetch(url)[source]

Fetch content from the web

Parameters:

url (str) – URL to fetch content from.

Returns:

tuple or None – Tuple of (content bytes, content type, charset) if the fetch was successful, else None.