fetchHtmlWithRetry method
Fetches HTML content with enhanced error handling and retry logic
This method adds additional error handling specifically for connection issues and implements a more robust retry mechanism with exponential backoff
Implementation
Future<String> fetchHtmlWithRetry({
required String url,
Map<String, String>? headers,
int? timeout,
int? retries,
int initialBackoffMs = 500,
double backoffMultiplier = 1.5,
int maxBackoffMs = 10000,
}) async {
// Use the WebScraper's fetchHtml method which now uses adaptive strategy
return fetchHtml(
url: url,
headers: headers,
timeout: timeout,
retries: retries,
);
}