url https://chinamarketmx.com/wp-content/uploads/TECAUD63967-300x300.png
img_data requests.get(url url,headers headers).content
#创建一个文件夹
if not os.path.exists( ./pictures ):
os.mkdir( ./pictures )
img_name pict .jpg
img_name img_name.encode( iso-8859-1 ).decode( gbk )
img_path pictures/ img_name
with open(img_path, wb ) as fp:
fp.write(img_data)
print(img_name, 下载成功 )