Skip to contents

Downloads the HTML source code from the official ANSES tiger mosquito map with configurable connection timeout, automatic retries with exponential backoff and jitter, and a descriptive User-Agent header.

Usage

fetch_tiger_mosquito_page(
  url = source_url_tiger_mosquito,
  timeout = 60,
  max_retries = 3,
  retry_delay = 5,
  user_agent = NULL,
  sleep_func = Sys.sleep
)

Arguments

url

The URL of the webpage to fetch. Defaults to the official ANSES tiger mosquito colonisation page.

timeout

Connection timeout in seconds. Default is 60.

max_retries

Maximum number of fetch attempts. Default is 3.

retry_delay

Base delay in seconds between retries (uses exponential backoff with jitter). Default is 5.

user_agent

Custom User-Agent header string. Defaults to alboFr/<version> (R <version>; <platform>).

sleep_func

Internal function used for delays during backoff. Defaults to Sys.sleep.

Value

A single character string containing the raw HTML content encoded in UTF-8.

Examples

if (FALSE) { # \dontrun{
# Fetch page with custom timeout and retries
page_html <- fetch_tiger_mosquito_page(timeout = 30, max_retries = 2)

# Reuse fetched page across data and metadata extraction
data <- get_tiger_mosquito_colonisation_in_france(page = page_html, output = "geojson")
meta <- get_tiger_mosquito_colonisation_metadata(page = page_html)
} # }