'用法示例:
'cscript bak.vbs 百度用户名 第I页 至第n页 目录列表.htm 用户名 密码
'例如我的blgo示例:
'cscript baidublogbak.vbs myvbscript 0 3 url.htm myvbscript mima
'表示从第0页备份到第3页,blog的共有页数打开http://hi.baidu.com/用户名/blog/index/0就可以看到了。url.htm存放的是目录列表
'注意的是百度是从0页计数的
'如果用户名和密码随便写也可以备份,但是无法备份私有文档
'推荐几页几页备份,最好建单独一个目录将bak.vbs放进去,会在当前目录生成mht文档。因为有的网络原因,有的无法成mht,请对照url.htm目录列表检查
'====================================================================================================
On Error Resume next
if (lcase(right(wscript.fullname,11))="wscript.exe") then
wscript.echo "Execute it under the cmd.exe Plz! Thx."
wscript.quit
end if
Const adSaveCreateNotExist = 1
Const adSaveCreateOverWrite = 2
Const adTypeBinary = 1
Const adTypeText = 2
Set args = WScript.Arguments
if args.Count = 0 then
WScript.Echo "Usage: CScript baidublogbak.vbs blogname i n url.htm username password"
WScript.Quit 1
end If
Set objMessage = CreateObject("CDO.Message")
Set ie=WScript.CreateObject("InternetExplorer.Application")
ie.visible=true
ie.navigate "http://passport.baidu.com/?login"
Do
Wscript.Sleep 200
Loop Until ie.ReadyState=4
ie.document.getElementById("username").value=args.Item(4)
ie.document.getElementById("password").value=args.Item(5)
tj=ie.document.getElementsBytagname("form")
tj.submit
WScript.Sleep 10000
Sub SaveToFile(Msg, Fn)
Dim Strm, Dsk
Set Strm = CreateObject("ADODB.Stream")
Strm.Type = adTypeText
Strm.Charset = "gb2312"
Strm.Open
Set Dsk = Msg.DataSource
Dsk.SaveToObject Strm, "_Stream"
Strm.SaveToFile Fn, adSaveCreateOverWrite
End Sub
For n=args.Item(1) To args.Item(2) Step 1
url="http://hi.baidu.com/"&args.Item(0)&"/blog/index/"&n
ie.Navigate url
ie.visible=false
While ie.Busy
WScript.Sleep 100
Wend
Do
Wscript.Sleep 200
Loop Until ie.ReadyState=4
wscript.echo "正保存第"&n&"页"
Wscript.Sleep 3000
For i=0 To ie.Document.links.length-1
If InStrRev(ie.Document.links(i).href,"blog/item/",-1,1)<> 0 And InStrRev(ie.Document.links(i).innerText,"浏览",-1,1)= 0 And InStrRev(ie.Document.links(i).href,"#comment",-1,1)= 0 And InStrRev(ie.Document.links(i).href,"cmtid",-1,1)= 0then
wscript.echo ie.Document.links(i).href &"||"&ie.Document.links(i).innerText
CreateObject("Scripting.FileSystemObject").OpenTextFile(args.Item(3),8,True,0).WriteLine(ie.Document.links(i).href &"||"&ie.Document.links(i).innerText)
objMessage.CreateMHTMLBody ie.Document.links(i).href
SaveToFile objMessage, ie.Document.links(i).innerText&".mht"
End if
Next
next
ie.quit
Set ie=nothing
'cscript bak.vbs 百度用户名 第I页 至第n页 目录列表.htm 用户名 密码
'例如我的blgo示例:
'cscript baidublogbak.vbs myvbscript 0 3 url.htm myvbscript mima
'表示从第0页备份到第3页,blog的共有页数打开http://hi.baidu.com/用户名/blog/index/0就可以看到了。url.htm存放的是目录列表
'注意的是百度是从0页计数的
'如果用户名和密码随便写也可以备份,但是无法备份私有文档
'推荐几页几页备份,最好建单独一个目录将bak.vbs放进去,会在当前目录生成mht文档。因为有的网络原因,有的无法成mht,请对照url.htm目录列表检查
'====================================================================================================
On Error Resume next
if (lcase(right(wscript.fullname,11))="wscript.exe") then
wscript.echo "Execute it under the cmd.exe Plz! Thx."
wscript.quit
end if
Const adSaveCreateNotExist = 1
Const adSaveCreateOverWrite = 2
Const adTypeBinary = 1
Const adTypeText = 2
Set args = WScript.Arguments
if args.Count = 0 then
WScript.Echo "Usage: CScript baidublogbak.vbs blogname i n url.htm username password"
WScript.Quit 1
end If
Set objMessage = CreateObject("CDO.Message")
Set ie=WScript.CreateObject("InternetExplorer.Application")
ie.visible=true
ie.navigate "http://passport.baidu.com/?login"
Do
Wscript.Sleep 200
Loop Until ie.ReadyState=4
ie.document.getElementById("username").value=args.Item(4)
ie.document.getElementById("password").value=args.Item(5)
tj=ie.document.getElementsBytagname("form")
tj.submit
WScript.Sleep 10000
Sub SaveToFile(Msg, Fn)
Dim Strm, Dsk
Set Strm = CreateObject("ADODB.Stream")
Strm.Type = adTypeText
Strm.Charset = "gb2312"
Strm.Open
Set Dsk = Msg.DataSource
Dsk.SaveToObject Strm, "_Stream"
Strm.SaveToFile Fn, adSaveCreateOverWrite
End Sub
For n=args.Item(1) To args.Item(2) Step 1
url="http://hi.baidu.com/"&args.Item(0)&"/blog/index/"&n
ie.Navigate url
ie.visible=false
While ie.Busy
WScript.Sleep 100
Wend
Do
Wscript.Sleep 200
Loop Until ie.ReadyState=4
wscript.echo "正保存第"&n&"页"
Wscript.Sleep 3000
For i=0 To ie.Document.links.length-1
If InStrRev(ie.Document.links(i).href,"blog/item/",-1,1)<> 0 And InStrRev(ie.Document.links(i).innerText,"浏览",-1,1)= 0 And InStrRev(ie.Document.links(i).href,"#comment",-1,1)= 0 And InStrRev(ie.Document.links(i).href,"cmtid",-1,1)= 0then
wscript.echo ie.Document.links(i).href &"||"&ie.Document.links(i).innerText
CreateObject("Scripting.FileSystemObject").OpenTextFile(args.Item(3),8,True,0).WriteLine(ie.Document.links(i).href &"||"&ie.Document.links(i).innerText)
objMessage.CreateMHTMLBody ie.Document.links(i).href
SaveToFile objMessage, ie.Document.links(i).innerText&".mht"
End if
Next
next
ie.quit
Set ie=nothing
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
暂无评论...
更新日志
2024年11月22日
2024年11月22日
- 张梦弘《大城小爱HQ》头版限量编号[低速原抓WAV+CUE]
- 张敬轩《MY 1ST COLLECTION》2CD[WAV+CUE][1.7G]
- 张玮伽《夜归人HQⅡ》2024头版限量编号[WAV+CUE][523M]
- 证声音乐图书馆《夏至 爵士境地》[320K/MP3][70.37MB]
- 孙露《同名专辑》限量1:1母盘直刻[低速原抓WAV+CUE]
- 【宝丽金唱片】群星《鼓舞飞扬》WAV+CUE
- 莫扎特弗雷德沃夏克肖斯塔科维奇《钢琴五重奏》(DG24-96)FLAC
- 证声音乐图书馆《夏至 爵士境地》[FLAC/分轨][360.16MB]
- 证声音乐图书馆《日落琴声 x 弦乐》[320K/MP3][71.2MB]
- 证声音乐图书馆《日落琴声 x 弦乐》[FLAC/分轨][342.58MB]
- 谢采妘2011《难忘的旋律(Non-StopChaCha)》马来西亚版[WAV+CUE]
- 林翠萍《听见林翠萍,记忆就会醒来》2CD[WAV+CUE]
- 木村好夫《天龍HIFI木吉他、木村好夫精选好歌》日本天龙版[WAV整轨]
- 证声音乐图书馆《日出琴声 x 民谣》[320K/MP3][53.76MB]
- 证声音乐图书馆《日出琴声 x 民谣》[FLAC/分轨][239.29MB]