Jump to content

how to translate responsetext to innertext

Recommended Posts


this is my code as follow:

#include <IE.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 903, 600, 267, 206)
$Edit1 = GUICtrlCreateEdit("responsetext", 8, 24, 425, 281)
$Edit2 = GUICtrlCreateEdit("$oIE.document.body.innerText", 440, 24, 449, 281)
$Button1 = GUICtrlCreateButton("test", 328, 312, 241, 30)
Global $oIE = _IECreateEmbedded()
GUICtrlCreateObj($oIE, 0, 350,  900,200 )
_IENavigate($oIE, "about:blank")

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
        Case  $Button1

Func test()
    Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
    $oHTTP.Open("GET",'https://www.autoitscript.com', False)
    Local $res = $oHTTP.responsetext
        Local $what_i_need = $oIE.document.body.innerText
    MsgBox(0,'this is the data i need:',$what_i_need)


in my code , $what_i_need  is the data i need

with ie obj ,  I can  translate  $res  to  $what_i_need  :

        Local $what_i_need = $oIE.document.body.innerText


But  i  don't want to use ie obj   ,so  how can i  translate  $res  to  $what_i_need ?


Edited by fenhanxue

Share this post

Link to post
Share on other sites
5 hours ago, Danp2 said:

Have you considered using _IECreate with the option to keep the window hidden?

i do not want to use the ie object  

so _IECreate is not   available  


Share this post

Link to post
Share on other sites

Load up the response into microsoft.xmldom (forum search this, many examples).  it also has an innertext ability.

  • Like 1

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post

Link to post
Share on other sites

You could do this:

Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
$oHTTP.Open("GET", 'https://www.autoitscript.com', False)
Local $sResponseText = $oHTTP.ResponseText

Local $omHtmlFile = ObjCreate("mhtmlfile")
;~ ConsoleWrite(IsObj($oObject) & @CRLF)
Local $sInnerText=$omHtmlFile.body.innerText
ConsoleWrite($sInnerText & @CRLF)


  • Like 1

Share this post

Link to post
Share on other sites

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


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.