import requests
import re
h={
'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
'Accept-Encoding':'gzip, deflate, br',
'Accept-Language':'zh-CN,zh;q=0.9',
'Connection':'keep-alive',
'Cookie':'PANWEB=1; BAIDUID=0AA8989EE068C6FE344F113401CCE038:FG=1; cflag=13%3A3; Hm_lvt_7a3960b6f067eb0085b7f96ff5e660b0=1554205137; Hm_lpvt_7a3960b6f067eb0085b7f96ff5e660b0=1554205589',
'Host':'pan.baidu.com',
'Upgrade-Insecure-Requests':'1',
'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36'
}
#pattern = re.compile(r'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-#9a-fA-F]))+')#抓出正常的 url链接
#urls = re.findall(pattern, 需要解析的str)
da = requests.get(urls[0], headers=h)
html = da.content
html_doc = str(html, 'utf-8') # html_doc=html.decode("utf-8","ignore")
if html_doc.find('class="error-img"') != -1:
print("有问题的:" + urls[0])
else:
print("正常的")