Jump to content

How to read text content from hta application


Ramnath
 Share

Recommended Posts

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

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().

:mellow:

Edited 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

$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

$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

Hi All,

Please help me to extracting text from hta application. Here with im attaching sample code of hta application.

Regards,

Ramnath

If 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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...