您如何获得最后一次使用Vbscript编辑外部HTML文档的信息

时间:2018-11-22 01:39:10

标签: vbscript

所以我有一个页面:www.example.com/thing/page.html

我想使用Visual Basic编写一个程序,该程序可以告诉我上次编辑该特定页面的时间。例如:

/thing/page.html: Last edited 1/1/18

有什么办法可以做到这一点?

1 个答案:

答案 0 :(得分:0)

Set File = WScript.CreateObject("Msxml2.XMLHTTP.6.0")
File.Open "GET", "https://www.google.com.au/search?q=cat", False
File.Open "GET", "https://www.mvps.org/serenitymacros/index.html", False
File.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C; .NET4.0E; BCD2000; BCD2000)"
File.Send

wscript.echo "==================" 
    wscript.echo "" 
    wscript.echo "Error " & err.number & "(0x" & hex(err.number) & ") " & err.description 
    wscript.echo "Source " & err.source 
    wscript.echo "" 
    wscript.echo "HTTP Error " & File.Status & " " & File.StatusText
    wscript.echo    File.getAllResponseHeaders
    wscript.echo    File.ResponseBody

如果,服务器发送信息,它将在响应头中。