fenhanxue Posted April 5, 2018 Share Posted April 5, 2018 (edited) this is my code as follow: expandcollapse popup#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") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 test() EndSwitch WEnd Func test() Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1") $oHTTP.Open("GET",'https://www.autoitscript.com', False) $oHTTP.Send() Local $res = $oHTTP.responsetext $oIE.document.write($res) Local $what_i_need = $oIE.document.body.innerText GUICtrlSetData($Edit1,$res) GUICtrlSetData($Edit2,$what_i_need) MsgBox(0,'this is the data i need:',$what_i_need) EndFunc in my code , $what_i_need is the data i need with ie obj , I can translate $res to $what_i_need : $oIE.document.write($res) 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 April 5, 2018 by fenhanxue Link to comment Share on other sites More sharing options...
Danp2 Posted April 5, 2018 Share Posted April 5, 2018 Have you considered using _IECreate with the option to keep the window hidden? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
fenhanxue Posted April 5, 2018 Author Share Posted April 5, 2018 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 Link to comment Share on other sites More sharing options...
Danp2 Posted April 5, 2018 Share Posted April 5, 2018 No need to be rude. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
jdelaney Posted April 6, 2018 Share Posted April 6, 2018 Load up the response into microsoft.xmldom (forum search this, many examples). it also has an innertext ability. Danp2 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. Link to comment Share on other sites More sharing options...
Danyfirex Posted April 6, 2018 Share Posted April 6, 2018 You could do this: Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1") $oHTTP.Open("GET", 'https://www.autoitscript.com', False) $oHTTP.Send() Local $sResponseText = $oHTTP.ResponseText Local $omHtmlFile = ObjCreate("mhtmlfile") ;~ ConsoleWrite(IsObj($oObject) & @CRLF) $omHtmlFile.write($sResponseText) Local $sInnerText=$omHtmlFile.body.innerText ConsoleWrite($sInnerText & @CRLF) Saludos mikell 1 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut 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