vbs- If LCase(Right(WSH.FullName, 11)) = "wscript.exe" Then
- CreateObject("WScript.Shell").run "%Comspec% /c cscript -nologo """ & WSH.ScriptFullName & """&pause"
- WSH.Quit
- End If
- Set html = CreateObject("htmlfile")
- Set http = CreateObject("Msxml2.ServerXMLHTTP")
- url="http://www.yssm.org/uctxt/109/109767/"
- html.designMode = "on"
- http.open "GET", url, False
- http.send
- htmltext = http.responseText
- rem 提取内容有两种方法,一种是正则,另一种解析DOM
- rem 排除方法有两种,一种是判断a标签的style属性,另一种是匹配标题,如第xx章
- html.write htmltext
- s="":Set list = html.getElementsByTagName("dd")
- For Each item in list
- Set a=item.getElementsByTagName("a")(0)
- If a.getAttribute("style") ="" Then
- s=s & url & split(a.getAttribute("href"),":")(1) & _
- " " & item.innerText & vbCrLf
- End If
- Next
- WSH.echo s
复制代码
|