如何使用requests從網絡上下載下傳一個圖像檔案
import requests
req = requests.get('http://t.cn/EfgN7gz')
# print(req.text)
with open('files/book.png', 'wb') as f:
f.write(req.content)
import requests
req = requests.get('http://t.cn/EfgN7gz')
# print(req.text)
with open('files/book.png', 'wb') as f:
f.write(req.content)