如何获取类似百度首面的代码
Global $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")$oHTTP.SetTimeouts(5000, 5000, 5000, 15000)
$oHTTP.Open("GET", $Location1, False)
$oHTTP.setRequestHeader("Connection", "Keep-Alive")
$oHTTP.setRequestHeader("User-Agent", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)")
$oHTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
$oHTTP.setRequestHeader("Accept-Encoding", "gzip, deflate")
$oHTTP.Send()
Sleep(1000)
$Source = $oHTTP.ResponseBody
ConsoleWrite($Source)
例如这样,好像办法获取首页的代码,如果加上default.html看到内容也不一样。 元老,能把问题描述的清楚一点吗~我的语文是体育老师教的~理解能力差 $bData = InetRead("http://www.baidu.com")
$sData = BinaryToString($bData,4)
MsgBox(262144,'Debug line ~' & @ScriptLineNumber,'Selection:' & @lf & '$sData' & @lf & @lf & 'Return:' & @lf & $sData & @lf & @lf & '@Error:' & @lf & @Error) ;### Debug MSGBOX 帮你点{:face (288):}
页:
[1]