python 时间戳转datetime时间格式
time1 = datetime.datetime.strptime(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(1559232000)),'%Y-%m-%d %H:%M:%S')
print(time1)
python 爬虫爬取https证书验证两种方式
requests.get(url,headers=headers,verify=False)
ssl._create_default_https_context = ssl._create_unverified_context
python 去除标签
pattern = re.compile(r'<[^>]+>', re.S)
content = pattern.sub('', content)
python 忽略无法解码的字符
content.decode('utf-8','ignore')
python unicode编码转汉字
content.encode("unicode_escape").decode("unicode_escape")