Ramnath Posted November 17, 2008 Share Posted November 17, 2008 Hi All, Please help as im new to Autoit. Im having Hta application which internally uses a java script file to display actual text content in the hta application. Please tell me how to extract text from hta application(main content in a external .js file). sample code: $oIE = _IEAttach ($oIE, "embedded") If @Extended Then MsgBox(0, "", "Attached to Existing Browser failed") EndIf $oH = _IEPropertyGet ($oIE,"innerhtml") MsgBox(0,"",$oH); Code sample displays only the current tags of hta but not the actual content of the .js file which is used in .htm file. Regards, Ramnath Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 17, 2008 Share Posted November 17, 2008 (edited) Hi All, Please help as im new to Autoit. Im having Hta application which internally uses a java script file to display actual text content in the hta application. Please tell me how to extract text from hta application(main content in a external .js file). sample code: $oIE = _IEAttach ($oIE, "embedded") If @Extended Then MsgBox(0, "", "Attached to Existing Browser failed") EndIf $oH = _IEPropertyGet ($oIE,"innerhtml") MsgBox(0,"",$oH); Code sample displays only the current tags of hta but not the actual content of the .js file which is used in .htm file. Regards, Ramnath Should be: $oIE = _IEAttach ($vID, "embedded") Where $vID is either title or HWND of the control. See the help file entry for _IEAttach(). Edited November 17, 2008 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Ramnath Posted November 18, 2008 Author Share Posted November 18, 2008 $oIE = WinGetTitle("LG ") $oIE = _IEAttach ($oIE, "embedded") If @Extended Then MsgBox(0, "", "Attached to Existing Browser failed") EndIf $oH = _IEPropertyGet ($oIE,"innerhtml") MsgBox(0,"",$oH); Im giving title only but still it is not giving the content Link to comment Share on other sites More sharing options...
DaleHohm Posted November 18, 2008 Share Posted November 18, 2008 $oH = _IEDocReadHTML ($oIE) Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
Ramnath Posted November 19, 2008 Author Share Posted November 19, 2008 (edited) Hi All, Please help me to extracting text from hta application. Here with im attaching sample code of hta application. Regards, RamnathsampleCode.zip Edited November 19, 2008 by Ramnath Link to comment Share on other sites More sharing options...
martin Posted November 19, 2008 Share Posted November 19, 2008 Hi All, Please help me to extracting text from hta application. Here with im attaching sample code of hta application. Regards, RamnathIf you just want the text from the hta file then you could use FileRead. If you need to extract a particular section then could use StringRegExp. $text = FileRead("some.hta") $section = StringRegExp($text,$someSearchCondition) ;or perhaps $section = _StringBetween($text,$start,$end) Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 19, 2008 Moderators Share Posted November 19, 2008 Do not create duplicate topics. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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