TomCat Posted May 20, 2008 Share Posted May 20, 2008 Hi some Question, in _INetGetSource it is possible to change user-agent in something else than Autoit. Is their any way to do the same with InetGet ? Link to comment Share on other sites More sharing options...
Armand Posted May 20, 2008 Share Posted May 20, 2008 Not as far as i know.... but you can. A. use an IE object and change the user-agent in there. B. write the entire TCP-IP connection stream and have it send the request with whatever user-agent you wish. [u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?! Link to comment Share on other sites More sharing options...
weaponx Posted May 20, 2008 Share Posted May 20, 2008 If you search the forum for winhttprequest you will find a lot of stuff. It helps if you provide a test site that we can actually use to try the script. Link to comment Share on other sites More sharing options...
TomCat Posted May 20, 2008 Author Share Posted May 20, 2008 Hi thank you for the fast Answer.Here an Testside wich respond the Browserversion:http://clandepotstatus.100webspace.net/test.php Link to comment Share on other sites More sharing options...
weaponx Posted May 20, 2008 Share Posted May 20, 2008 $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("POST", "http://clandepotstatus.100webspace.net/test.php") $oHTTP.SetRequestHeader("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; InfoPath.1)") $oHTTP.Send() $Headers = $oHTTP.GetAllResponseHeaders() ConsoleWrite("+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< HEADERS <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" & @CRLF) ConsoleWrite($Headers & @CRLF) $Source = $oHTTP.ResponseText ConsoleWrite("+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< CONTENT <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" & @CRLF) ConsoleWrite($Source & @CRLF) Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"","We intercepted a COM Error !" & @CRLF & _ "Number is: " & $HexNumber & @CRLF & _ "Windescription is: " & $oMyError.windescription ) SetError(1) Endfunc Link to comment Share on other sites More sharing options...
TomCat Posted May 21, 2008 Author Share Posted May 21, 2008 Thank you very much. To chance user-agent works fine, but now I have no idear how to download files with this like with InetGet. What i need is to download binary files... Can you help me ? Link to comment Share on other sites More sharing options...
weaponx Posted May 21, 2008 Share Posted May 21, 2008 (edited) Thank you very much. To chance user-agent works fine, but now I have no idear how to download files with this like with InetGet.What i need is to download binary files...Can you help me ? In the case of a file you use FileOpen in binary mode and use $oHTTP.ResponseText or $oHTTP.ResponseBody to write to the file.See this vbscript example:http://cwashington.netreach.net/depo/view.asp?Index=1080 Edited May 21, 2008 by weaponx Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now