抓包显示是乱码
image.png抓取
保存二进制格式即可
#!/usr/bin/env python
# encoding=utf-8
import requests
headers = {
'Host': 'zimaoda.com',
'Connection': 'keep-alive',
'Accept': 'image/avif,image/webp,image/apng,image/*,*/*;q=0.8',
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'zh-CN,zh;q=0.9'
}
url = 'http://zimaoda.com/index/loginValCode'
req = requests.get(url = url,headers = headers)
text = req.content # 二进制数据
with open('a.png', 'wb') as f:
f.write(text)
网友评论