- import requestsurls = [ "https://example1.com", "https://example2.com", "https://example3.com", # ...其他链接]for url in urls: try: response = requests.get(url) if response.status_code == 404: print(f"链接返回404:{url}") except requests.exceptions.RequestException as e: print(f"请求过程中出现错误:{url}") print(f"错误详细信息:{e}")
复制代码 |