Pycrolis commited on
Commit
181c63d
·
1 Parent(s): 9e2fac8

feat(web_page_extractor_tool): add timeout to HTTP requests

Browse files
tools/web_page_information_extractor.py CHANGED
@@ -50,7 +50,7 @@ def web_page_information_extractor(url: str, request: str) -> str:
50
  return extracted_information.content
51
 
52
  def _get_text_from_url(url: str) -> str:
53
- response = requests.get(url, headers={"User-Agent": "Mozilla/5.0"})
54
  response.raise_for_status() # Raises HTTPError for bad responses
55
  html = response.text
56
 
 
50
  return extracted_information.content
51
 
52
  def _get_text_from_url(url: str) -> str:
53
+ response = requests.get(url, timeout=15, headers={"User-Agent": "Mozilla/5.0"})
54
  response.raise_for_status() # Raises HTTPError for bad responses
55
  html = response.text
56