incepator Posted October 20, 2014 Posted October 20, 2014 Hi guys.I have a question if you can help ...I can set the referer to a page, it seems that is not so simple. IE functions do not offer this option, but I managed to set a referer using functions from "WinHttp.au3" I need to modify this script so that it appears in the IE page, this referer. #include <WinHttp.au3> #include<Ie.au3> $hw_open = _WinHttpOpen("WinHTTP Example") $hw_connect = _WinHttpConnect($hw_open, "whatismyreferer.com") $h_openRequest = _WinHttpOpenRequest($hw_connect, Default, Default, Default, "newwebsite.com") _WinHttpSendRequest($h_openRequest) _WinHttpReceiveResponse($h_openRequest) If _WinHttpQueryDataAvailable($h_openRequest) Then $header = _WinHttpReadData($h_openRequest) EndIf _WinHttpCloseHandle($h_openRequest) _WinHttpCloseHandle($hw_connect) _WinHttpCloseHandle($hw_open) MsgBox(0, "", $header) Local $oIE = _IECreate("whatismyreferer.com")
trancexx Posted October 20, 2014 Posted October 20, 2014 If I may ask, why would you use IE at all if WinHttp works? ♡♡♡ . eMyvnE
incepator Posted October 20, 2014 Author Posted October 20, 2014 Hi trancexx, I need to see the web page ... with the result, not just to read the source code.
JohnOne Posted October 20, 2014 Posted October 20, 2014 The question was "why" It's a pretty valid one for curiosity. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Solution trancexx Posted October 20, 2014 Solution Posted October 20, 2014 Aha, ok. #include <IE.au3> Local $oIE = _IECreate() $oIE.Navigate2("http://whatismyreferer.com", Default, Default, Default, 'Referer: "newwebsite.com"') incepator 1 ♡♡♡ . eMyvnE
incepator Posted October 20, 2014 Author Posted October 20, 2014 Thank you, @trancexx. JohnOne, respect for all you do for AutoIt. I just need to make a small software for me.
JohnOne Posted October 20, 2014 Posted October 20, 2014 I see you can do that for user agent too. Pretty cool, and I'm sure that in the past I've had issues automating things because there was no referer using _IENavigate(). AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
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