回复 14# tbjx138
略微改了一下- Set http = CreateObject("msxml2.xmlhttp")
- Set fso = CreateObject("scripting.filesystemobject")
- Function Gethtml(url)
- MsgBox url
- http.open "GET",url,False
- http.send()
- Gethtml = http.responsetext
- End Function
- burl = InputBox("url")
- Set f = fso.createtextfile("1.txt",True,True)
- For i = 0 To 1000
- Set Document = CreateObject("htmlfile")
- Document.designmode = "on"
- html = gethtml(burl & "?sort=score&start="&i*20)
- If InStr(html,"你没有权限访问这个页面") = -1 Then
- WScript.quit
- End If
- Document.write html
- Dim score
- For Each div In Document.Getelementsbytagname("div")
- If div.Classname = "blockquote-list score bottom-line" Then
- Set score = div
- Exit For
- End If
- Next
- Set ul = score.children(0)
- For Each li In ul.children
- f.writeline li.InnerText
- f.writeline ""
- Next
- Next
复制代码 就是爬原文摘录的
也要加上/ |