class_docstr: LinkContentFetcher is a component for fetching and extracting content from URLs. It supports handling various
  content types, retries on failures, and automatic user-agent rotation for failed web requests.
class_docstr_tok: ["LinkContentFetcher","is","a","component","for","fetching","and","extracting","content","from","URLs",".","It","supports","handling","various","content","types",",","retries","on","failures",",","and","automatic","user-agent","rotation","for","failed","web","requests","."]
docstr: Fetches content from a URL and returns it as a ByteStream.
  
  If `raise_on_failure` is set to True, this method will wrap the fetch() method and catch any exceptions.
  Otherwise, it will simply call the fetch() method.
  :param url: The URL to fetch content from.
  :return: A tuple containing the ByteStream metadata dict and the corresponding ByteStream.
docstr_tok: ["Fetches","content","from","a","URL","and","returns","it","as","a","ByteStream",".","If","`","raise_on_failure","`","is","set","to","True",",","this","method","will","wrap","the","fetch","(",")","method","and","catch","any","exceptions",".","Otherwise",",","it","will","simply","call","the","fetch","(",")","method",".",":","param","url",":","The","URL","to","fetch","content","from",".",":","return",":","A","tuple","containing","the","ByteStream","metadata","dict","and","the","corresponding","ByteStream","."]
code: def _fetch_with_exception_suppression(
      self, url: str
  ) -> Tuple[Optional[Dict[str, str]], Optional[ByteStream]]:
      """
      Fetches content from a URL and returns it as a ByteStream.
  
      If `raise_on_failure` is set to True, this method will wrap the fetch() method and catch any exceptions.
      Otherwise, it will simply call the fetch() method.
      :param url: The URL to fetch content from.
      :return: A tuple containing the ByteStream metadata dict and the corresponding ByteStream.
  
      """
      if self.raise_on_failure:
          try:
              return self.fetch(url)
          except Exception as e:
              logger.warning("Error fetching %s: %s", url, str(e))
              return {"content_type": "Unknown", "url": url}, None
      else:
          return self.fetch(url)
  
file_path: haystack/haystack/components/fetchers/link_content.py
imports: import logging
  from collections import defaultdict
  from concurrent.futures import ThreadPoolExecutor
  from typing import Callable, Dict, List, Optional, Tuple
  import requests
  from requests import Response
  from requests.exceptions import HTTPError
  from tenacity import RetryCallState, retry, retry_if_exception_type, stop_after_attempt, wait_exponential
  from haystack import component
  from haystack.dataclasses import ByteStream
  from haystack.version import __version__
label_desc: Use image node_id 4 for calling the LinkContentFetcher obj's underlying member method code with example usage: obj._fetch_with_exception_suppression(url) and returns: self, self, dict,  None