美文网首页
Python 直接打开网页Url图片

Python 直接打开网页Url图片

作者: 富竹 | 来源:发表于2020-04-18 22:40 被阅读0次
import requests
from PIL import Image
from io import BytesIO

img_src = 'your image url path'

response = requests.get(img_src)
image = Image.open(BytesIO(response.content))

image.show()

后续还可以进行其他操作,比如保存等。

相关文章

网友评论

      本文标题:Python 直接打开网页Url图片

      本文链接:https://www.haomeiwen.com/subject/hlbzvhtx.html