Jump to content

Recommended Posts

Posted

I have been using the following to pull page source from pages which do not require a log in.

$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oRet = _HTTPRequest($oHTTP, "GET", "http://www.awebsite.com")

Func _HTTPRequest($oHTTP, $oMethod, $oURL, $oData)
    $oHTTP.Open($oMethod, $oURL, False)
    If $oMethod = "POST" Then $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
    $oHTTP.Send($oData)
    Return $oHTTP.ResponseText
EndFunc

Would I be able to also use ObjCreate("winhttp.winhttprequest.5.1") to get page source from behind a log in? I have looked at some other options such as INet.au3, and WinHTTP.au3, but am not sure if they will work. What method would be best for me to look into, any suggestions would be greatly appreciated. I am looking to run many instances of the same script on the same computer, and with IE being a resource hog in comparison, it really isn't an option for me. Thanks for any help. =)

  • 1 month later...
Posted

Send a post request to log in maybe?

Nothing is stopping you from having a go! :)

i have bin try login with :

$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")

$oRet = _HTTPRequest($oHTTP, "GET", "http://www.awebsite.com")

Func _HTTPRequest($oHTTP, $oMethod, $oURL, $oData)

$oHTTP.Open($oMethod, $oURL, False)

If $oMethod = "POST" Then $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")

$oHTTP.Send($oData)

Return $oHTTP.ResponseText

EndFunc

but it don't working

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...