MCPcopy Create free account
hub / github.com/TornadoInsight/Sora-FullStack / check_url

Function check_url

scripts/export_aitools.py:20–31  ·  view source on GitHub ↗
(url:str)

Source from the content-addressed store, hash-verified

18
19
20def check_url(url:str)->bool:
21 try:
22 response = requests.get(url, timeout=3) # 设置超时为3秒
23 if response.status_code == 200:
24 print(f"{url} is alive.")
25 return True
26 else:
27 print(f"{url} might not be alive, status code: {response.status_code}")
28 return False
29 except requests.RequestException as e:
30 print(f"Error checking {url}: {e}")
31 return False
32
33
34# 查找所有<a>标签并提取href属性

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected