我剛纔寫了一個vbs腳本,該腳本經過調用com組件winhttp來獲取網頁中圖片的數據,而且以二進制數據的形式返回。
再經過adodb.steam對象將二進制數據保存爲圖片文件。app
Sub DownloadPic(url,strPath) Set Winhttp = CreateObject("WinHttp.WinHttpRequest.5.1") Winhttp.Open "GET", url Winhttp.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded" Winhttp.Send Set sGet = CreateObject("ADODB.Stream") sGet.Mode = 3 sGet.Type = 1 sGet.Open() sGet.Write(Winhttp.ResponseBody) sGet.SaveToFile strPath End Sub
在此將代碼分享給你們。ide