python Image open读取网络图片本地显示 爬虫必备

 

 

#!/usr/bin/python3
# -*- coding: utf-8 -*-

import requests
from PIL import Image
from io import BytesIO

response = requests.get('https://static.geetest.com/pictures/gt/5629ed821/5629ed821.webp')
response = response.content

BytesIOObj = BytesIO()
BytesIOObj.write(response)
img = Image.open(BytesIOObj)
img.show()

 

原文链接:https://blog.csdn.net/qq_38691608/article/details/87535766

posted @ 2019-10-13 13:45  PythonGirl  阅读(4873)  评论(0编辑  收藏  举报