
DimPages
DimForm
ClassDisplay
Privatem_IE
Privatem_HTML
PublicSubLoad()
Setm_IE=wscript.createobject("internetexplorer.application","event_")
Withm_IE
.menubar=0
.addressbar=0
.toolbar=0
.statusbar=0
.width=500
.height=800
.resizable=0
.navigate"about:blank"
.left=fix((.document.parentwindow.screen.availwidth-.width)/2)
.top=fix((.document.parentwindow.screen.availheight-.height)/2)
.Visible=True
EndWith
EndSub
PublicSubAdd(byvalText)
Withm_IE.Document
.close
M_HTML="<spanstyle=""display:block;font-size:12px;font-family:""微软雅黑"";"">"&Text&"</span>"&M_HTML
.writeM_HTML
EndWith
EndSub
publicSubStudown()
m_IE.Quit
Setm_IE=Nothing
EndSub
EndClass
SubDownload(byvalPath)
SetFso=CreateObject("Scripting.FileSystemObject")
SetxPost=createObject("Microsoft.XMLHTTP")
xPost.Open"GET",Path,0
xPost.Send()
SetsGet=createObject("ADODB.Stream")
DimMu
MU=Fso.GetParentFolderName(wscript.scriptfullname)
DimFiler
Filer=Right(Path,Len(Path)-InStrRev(Path,"/"))
WithsGet
.Mode=3
.Type=1
.Open()
.WritexPost.responseBody
IfNotFso.folderExists(Mu&"\Download")Then
Fso.CreateFolderMu&"\Download"
EndIf
.SaveToFileMu&"\Download\"&Filer&".jpg",2
Form.Add"下载成功:"&Path
EndWith
EndSub
SubParse(byvalPath)
DimIE
SetIE=WScript.CreateObject("InternetExplorer.Application")
WithIE
.Visible=false
.NavigatePath
EndWith
Do
WScript.Sleep100
LoopUntilNot(IE.Busy)AndIE.ReadyState=4
IfLen(ie.Document.Location)Then
WScript.Sleep1000
'msgboxIE.document.documentElement.outerHTML
IfNot(Pages)Then
Pages=GetPage(IE.Document.getElementsByTagName("span"))
EndIf
DimImages
SetImages=IE.Document.images
DimImage,Source,Feature,MuDi
Feature="http://img.yo9.com/"
ForEachImageInImages
Source=Image.src
MuDi=InStr(Source,Feature)
IfMuDiThen
CallDownload(Source)
WScript.Sleep100
EndIf
Next
EndIf
ie.Quit
EndSub
FunctionRep(byvalText)
DimFlag
Flag=InStrRev(Text,"#!page=")
IfFlagThenText=Left(Text,Flag-1)
Rep=Text
EndFunction
FunctionGetPage(ByvalSpans)
DimSpan,Flag
Flag=False
ForEachSpanInSpans
IfSpan.className="pagedisabled"Then
Flag=True
Else
GetPage=0
IfFlagThen
IfNot(Span.innerText="...")Then
GetPage=Span.innerText
ExitFor
EndIf
EndIf
EndIf
Next
EndFunction
SubMain(byvalPath)
SetForm=NewDisplay
Form.Load
Form.Add"载入第1个网站"
CallParse(Path)
IfPagesThen
Dimi
Fori=2ToPages
Form.Add"载入第"&i&"个网站"
CallParse(Path&"#!page="&i)
Next
EndIf
Form.Studown
EndSub
CallMain(Rep(InputBox("请输入网站地址:")))
DimForm
ClassDisplay
Privatem_IE
Privatem_HTML
PublicSubLoad()
Setm_IE=wscript.createobject("internetexplorer.application","event_")
Withm_IE
.menubar=0
.addressbar=0
.toolbar=0
.statusbar=0
.width=500
.height=800
.resizable=0
.navigate"about:blank"
.left=fix((.document.parentwindow.screen.availwidth-.width)/2)
.top=fix((.document.parentwindow.screen.availheight-.height)/2)
.Visible=True
EndWith
EndSub
PublicSubAdd(byvalText)
Withm_IE.Document
.close
M_HTML="<spanstyle=""display:block;font-size:12px;font-family:""微软雅黑"";"">"&Text&"</span>"&M_HTML
.writeM_HTML
EndWith
EndSub
publicSubStudown()
m_IE.Quit
Setm_IE=Nothing
EndSub
EndClass
SubDownload(byvalPath)
SetFso=CreateObject("Scripting.FileSystemObject")
SetxPost=createObject("Microsoft.XMLHTTP")
xPost.Open"GET",Path,0
xPost.Send()
SetsGet=createObject("ADODB.Stream")
DimMu
MU=Fso.GetParentFolderName(wscript.scriptfullname)
DimFiler
Filer=Right(Path,Len(Path)-InStrRev(Path,"/"))
WithsGet
.Mode=3
.Type=1
.Open()
.WritexPost.responseBody
IfNotFso.folderExists(Mu&"\Download")Then
Fso.CreateFolderMu&"\Download"
EndIf
.SaveToFileMu&"\Download\"&Filer&".jpg",2
Form.Add"下载成功:"&Path
EndWith
EndSub
SubParse(byvalPath)
DimIE
SetIE=WScript.CreateObject("InternetExplorer.Application")
WithIE
.Visible=false
.NavigatePath
EndWith
Do
WScript.Sleep100
LoopUntilNot(IE.Busy)AndIE.ReadyState=4
IfLen(ie.Document.Location)Then
WScript.Sleep1000
'msgboxIE.document.documentElement.outerHTML
IfNot(Pages)Then
Pages=GetPage(IE.Document.getElementsByTagName("span"))
EndIf
DimImages
SetImages=IE.Document.images
DimImage,Source,Feature,MuDi
Feature="http://img.yo9.com/"
ForEachImageInImages
Source=Image.src
MuDi=InStr(Source,Feature)
IfMuDiThen
CallDownload(Source)
WScript.Sleep100
EndIf
Next
EndIf
ie.Quit
EndSub
FunctionRep(byvalText)
DimFlag
Flag=InStrRev(Text,"#!page=")
IfFlagThenText=Left(Text,Flag-1)
Rep=Text
EndFunction
FunctionGetPage(ByvalSpans)
DimSpan,Flag
Flag=False
ForEachSpanInSpans
IfSpan.className="pagedisabled"Then
Flag=True
Else
GetPage=0
IfFlagThen
IfNot(Span.innerText="...")Then
GetPage=Span.innerText
ExitFor
EndIf
EndIf
EndIf
Next
EndFunction
SubMain(byvalPath)
SetForm=NewDisplay
Form.Load
Form.Add"载入第1个网站"
CallParse(Path)
IfPagesThen
Dimi
Fori=2ToPages
Form.Add"载入第"&i&"个网站"
CallParse(Path&"#!page="&i)
Next
EndIf
Form.Studown
EndSub
CallMain(Rep(InputBox("请输入网站地址:")))
