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()
后续还可以进行其他操作,比如保存等。
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
网友评论