代码(python):需要安装requests和easygui库
import easygui
import requests
def check_mimikko():
url = "https://www.mimikko.cn/"
try:
response = requests.get(url)
if response.status_code == 200:
easygui.msgbox(msg="兽耳科技是存在的!",title="检测结果",ok_button="确定")
else:
easygui.msgbox(msg="OH NO!兽耳科技已经瓦解了",title="检测结果",ok_button="确定")
except requests.RequestException as e:
easygui.msgbox(msg="OH NO!兽耳科技已经瓦解了",title="检测结果",ok_button="确定")
easygui.msgbox(msg="点击下面的按钮检测兽耳科技是否存在",title="一键检测兽耳科技是否存在",ok_button="开始检测")
try:
requests.get("https://www.baidu.com")
check_mimikko()
except requests.RequestException as e:
easygui.msgbox(msg="网络错误,请检查网络是否正常?",title="检测结果",ok_button="确定")