Originally posted by s11ss at 2008-11-3 07:48 PM:
baidu的页面不存在也会返回200,可以把得到的网页内容和http://www.baidu.com/search/error.html的比较,相同的话就是页面不存在,vbs可以实现
即是如此有请 s11ss 兄该帮改良改良,(下面的返回时间太长)
On Error Resume Next
Set oDOM=WScript.GetObject("http://www.baidu.com/10000.txt")
if err.Number<>0 then
WScript.echo "不存在"
WScript.quit
end if
Do Until oDOM.readyState="complete"
WScript.sleep 200
Loop
s = oDOM.documentElement.outerText
Set oDOM=nothing
if InStr(s, "不存在")>0 or InStr(s, "未找到") then WScript.echo "不存在"