MikeMotley Posted January 11, 2008 Share Posted January 11, 2008 I'm trying to read the body text/source from an open web browser, not create a new browser window with a specific url. I have read the material in the help file, but it always references something like: $oIE = _IE_Example ("basic") $sText = _IEBodyReadText ($oIE) Where the _IEBodyReadText is looking at the variable $oIE, which is the "basic" part of _IE_Example. I just want to use an already open browser window, and tell _IEBodyRead* to look for a browser with a particular name in the title bar. -mike Link to comment Share on other sites More sharing options...
Swift Posted January 11, 2008 Share Posted January 11, 2008 (edited) CONGRATULATIONSTo Your First Post.Your First Post 'lil Guy Welcome To The AutoIt Script Forums------Good Luck With All Your Scripts.Your First Post. CONGRATS!!!!Not 100% Sure Of What Your Asking. Edited January 11, 2008 by Swift Link to comment Share on other sites More sharing options...
Swift Posted January 11, 2008 Share Posted January 11, 2008 your tring to read everything in a IE window? if so...what are you doing with it? saving it as a .txt file? HTML File? ==---SwiftY---== Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 11, 2008 Share Posted January 11, 2008 (edited) I'm trying to read the body text/source from an open web browser, not create a new browser window with a specific url. I have read the material in the help file, but it always references something like: $oIE = _IE_Example ("basic") $sText = _IEBodyReadText ($oIE) Where the _IEBodyReadText is looking at the variable $oIE, which is the "basic" part of _IE_Example. I just want to use an already open browser window, and tell _IEBodyRead* to look for a browser with a particular name in the title bar. -mike You need to get a pointer to the browser DOM object. That is usually called $oIE. To get the object from an already existing browser, use _IEAttach(), which is in the help file. Look at the examples in the help file under that function. #include <IE.au3> $oIE = _IEAttach("Some IE Browser Title", "Title") $sHTML = _IEBodyReadHTML($oIE) ConsoleWrite("Debug: $sHTML = " & $sHTML & @LF) Edited January 11, 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...
MikeMotley Posted January 11, 2008 Author Share Posted January 11, 2008 You need to get a pointer to the browser DOM object. That is usually called $oIE. To get the object from an already existing browser, use _IEAttach(), which is in the help file. Look at the examples in the help file under that function. #include <IE.au3> $oIE = _IEAttach("Some IE Browser Title", "Title") $sHTML = _IEBodyReadHTML($oIE) ConsoleWrite("Debug: $sHTML = " & $sHTML & @LF) That's *exactly* what I wanted to do. Thanks for pointing that out. What I wanted to do is some more reliable way to detect the page being completely loaded, click on javascript links, and other general interaction with the page. This seems like it will do just that. Thanks for your help! Link to comment Share on other sites More sharing options...
DaleHohm Posted January 11, 2008 Share Posted January 11, 2008 Actually, that is what _IELoadWait is for... 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...
MikeMotley Posted January 11, 2008 Author Share Posted January 11, 2008 I wanted to use _IEloadwait but I couldn't figure out how to tell autoIT to use an already open browser window. I'm still having trouble with it, using this code: #include <IE.au3> $oIE = _IEAttach ("Title of already open IE window") $sHTML = _IEBodyReadHTML($oIE) MsgBox(0, "Document Source", $sHTML) I expect to get the body of the IE window printed to the MsgBox, but it just gives me a MsgBox with a 0 in it. Link to comment Share on other sites More sharing options...
DaleHohm Posted January 11, 2008 Share Posted January 11, 2008 I'll guess the top level document is a FRAMESET. Suggest you try DebugBar (see my sig) and look at _IEFrameGetObjByName. 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...
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