import requests,easygui A = easygui.enterbox(i) if ((A in"https://") or (A in"http://")): pachong_1 = requests.get(A) elif((A in"edge://") or (A in"chorme://")): if easygui.ynbox('这个网站可能跟浏览器有关。如果爬取,可能会损坏浏览器。确定继续?','爬取信息',('确定爬取','结束爬取')): pachong_1 = requests.get(A) else: if(easygui.ynbox('网站是否采用了https协议?','爬取信息',('已采用','未采用'))): pachong_1 = requests.get("https://" + A) A = "https://" + A else: pachong_1 = requests.get("http://" + A) A = "http://" + A if A != None: pachong_2 = pachong_1.text easygui.msgbox(pachong_2,'爬取信息-' + A,'结束')