Jump to content
Sign in to follow this  
Ramnath

How to read text content from hta application

Recommended Posts

Ramnath

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

Share this post


Link to post
Share on other sites
PsaltyDS

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

Share this post


Link to post
Share on other sites
Ramnath

$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

Share this post


Link to post
Share on other sites
DaleHohm

$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

Share this post


Link to post
Share on other sites
Ramnath

Hi All,

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

Regards,

Ramnath

sampleCode.zip

Edited by Ramnath

Share this post


Link to post
Share on other sites
martin

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.

Share this post


Link to post
Share on other sites
SmOke_N

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.

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
Sign in to follow this  

×

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.