本帖最后由 apang 于 2013-1-14 21:48 编辑
- Set ie = CreateObject("InternetExplorer.Application")
- ie.Navigate "http://www.bathome.net"
- ie.Visible = False
- Do While ie.Busy Or ie.ReadyState <> 4 :Wscript.Sleep 100 :Loop
- Text = ie.Document.Body.InnerHtml :ie.Quit
- Pattern1 = """>(.*?)</A>.*href=""(thread.*)"">(.*)</A>"
- Pattern2 = "id=homegrids_t_[1-3]>(?:(最新主题|最新回复|热门主题))"
-
- Set Re = New RegExp
- Re.Pattern = Pattern1 & "|" & Pattern2
- Re.Global = True
- Re.IgnoreCase = True
- For Each a in Re.Execute(Text)
- Set FSO=CreateObject("Scripting.FilesystemObject")
- Str = "[" & a.SubMatches(3) & "]"
- if Str = "[]" Then
- Str = "主题:" & a.SubMatches(2) & " "
- Str = Str & "发贴ID:" & a.SubMatches(0) & " " & "URL:"
- Str = Str & "http://www.bathome.net/" & a.SubMatches(1)
- End If
- FSO.OpenTextFile("Result.txt",8,True).WriteLine Str
- Set FSO = Nothing
- Next
-
- CreateObject("Wscript.Shell").Run "NotePad Result.txt"
复制代码
|