将复制的图片链接保存到本地,然后通过python脚本将链接中的图片下载到本地。
[color=]import
requests
[color=],
time
#
打开存放的图片链接的文件夹
f=
[color=]open
(
[color=]"D:/tb.txt"
[color=],
[color=]"r"
[color=],
[color=]encoding
=
[color=]"utf-8"
)
list = f.readlines()
list2 = []
[color=]for
i
[color=]in
list:
#
去除换行符
list2.append(i.replace(
[color=]"
[color=]\n
[color=]"
[color=],
[color=]""
))
i=1
[color=]for
url
[color=]in
list2:
resp = requests.get(url).content
#
保存文件
f =
[color=]open
(
[color=]f"C:/Users/Administrator/Desktop/
[color=]店铺装修
[color=]/
[color=]原图
[color=]/
[color=]{
i
[color=]}
[color=].jpg"
[color=],
[color=]"wb"
)
i+=1
[color=]
f.write(resp)
time.sleep(
[color=]1
)