saikumar Posted May 21, 2005 Posted May 21, 2005 Hi , I am using AutoIt for web automation. I want to check some text displayed on the web page after an operation. HTML Body control name is Internet Explorer_Server1 and I got the handler to this but when i call ControlGetText with this it is giving empty string. But If use ControlClick ( $whandle,"", $hwnd , "right",1 ) it works fine. Can any one help me. Thanks Regards Sai Kumar
/dev/null Posted May 22, 2005 Posted May 22, 2005 HTML Body control name is Internet Explorer_Server1 and I got the handler to this but when i call ControlGetText with this it is giving empty string.As it seems, ControlGetText does not work with every control, as it obviously depends on the control if you can "extract" the text. It's easy for an edit Control (notepad). However, vim (another editor) uses it's own control to view and edit text (VimTextArea1). Using the "AutoIT Window Info" tool, I'm getting the following visible Window Text for notepad: TEST MESSAGE 1 2 3 vim: Vim text area, ScreollbarI typed the same text into both editors. I guess it's the same for IE. You won't be able to get the text of a web page from "Internet Explorer_Server1".Better use InetGet (see help) to retrieve a web page and parse that page for anychanges.CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *
TuMbLeWeEd Posted May 22, 2005 Posted May 22, 2005 You also could scan the Temp Internetfiles dir befor page load and after to get the filename that contains the loaded page (did not try that, should work) or a screenreader wich will be much slower and not easy to do (differentfonts, fontsizes, images,linespacing, ...... to long) My AutoIt stuffChatBichProjectSelectorWindow control grabberUsefull LinksPort forwarding with routers
DaleHohm Posted May 22, 2005 Posted May 22, 2005 Using 3.1.1++ you can use the COM interface and then use the DOM (Document Object Model) for IE to retrieve the text. I can't recite the correct object hierarchy off the top of my head because it always takes some messing around for me to get it right, but it can be done. 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
GaryFrost Posted May 23, 2005 Posted May 23, 2005 try ControlGetHandle SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
saikumar Posted May 23, 2005 Author Posted May 23, 2005 Using 3.1.1++ you can use the COM interface and then use the DOM (Document Object Model) for IE to retrieve the text. I can't recite the correct object hierarchy off the top of my head because it always takes some messing around for me to get it right, but it can be done.Dale<{POST_SNAPBACK}>Can u breif on this or quote with a small example .How do i integrate a dll into autoit script
saikumar Posted May 23, 2005 Author Posted May 23, 2005 As it seems, ControlGetText does not work with every control, as it obviously depends on the control if you can "extract" the text. It's easy for an edit Control (notepad). However, vim (another editor) uses it's own control to view and edit text (VimTextArea1). Using the "AutoIT Window Info" tool, I'm getting the following visible Window Text for notepad: TEST MESSAGE 1 2 3 vim: Vim text area, ScreollbarI typed the same text into both editors. I guess it's the same for IE. You won't be able to get the text of a web page from "Internet Explorer_Server1".Better use InetGet (see help) to retrieve a web page and parse that page for anychanges.CheersKurt<{POST_SNAPBACK}>Can u tell me some thing abt vim. Is it a tolol to find windo info.
DaleHohm Posted May 23, 2005 Posted May 23, 2005 Can u breif on this or quote with a small example .How do i integrate a dll into autoit script<{POST_SNAPBACK}>Here's an example. It shows you the text on the www.amazon.com page. There are tons of properties for the document object... Google search or use MSDN for more info. Also search these forums for InternetExplorer.Application for a lot more examples.$ObjIE=ObjCreate("InternetExplorer.Application") With $ObjIE .Visible = True .Navigate("http://www.amazon.com") Do Sleep(50) Until .ReadyState = 4 EndWith $theText = $ObjIE.document.body.outertext ConsoleWrite($theText) 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
kenn Posted February 28, 2006 Posted February 28, 2006 Opt('WinTitleMatchMode', 2) $w = WinGetHandle('Internet Explorer') while ControlGetFocus($w) <> 'Internet Explorer_Server1' ControlFocus($w, '', 'Internet Explorer_Server1') wend ControlSend($w, '', 'Internet Explorer_Server1', '^a^c') Sleep(3000) ;can probably reduce this MsgBox(48, 'Internet Explorer_Server1 Text', ClipGet()) exit
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