Shonnie Posted November 7, 2007 Share Posted November 7, 2007 Hey, first of all, heres my code: #include <IE.au3> $oIE = _IEAttach("Slasher", "embedded ") $oDiv = _IEGetObjById($oIE, "playerStats") FileWriteLine("Text.txt", $oDiv) What I was aiming for, was copying the text inside a DIV tag, from generated source on a java applet. Heres the DIV tag and some surrounding code: <div id="playerStats"> <div class="statLabel">Life:</div> <div class="statValue">657 / 794</div> What I'm making, is a program that looks at this, and saves it to a text file. Yes, this is messy, but just until I get it to work So, any enlightenment out there? Link to comment Share on other sites More sharing options...
DaleHohm Posted November 7, 2007 Share Posted November 7, 2007 You're missing the /div for the first div element, but I'll assume it follows the other two divs... Change FileWriteLine("Text.txt", $oDiv) to FileWriteLine("Text.txt", _IEPropertyGet($oDiv, "innertext")) 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...
Shonnie Posted November 7, 2007 Author Share Posted November 7, 2007 (edited) Works great thanks Now how can i get info out of a div class? Specifically, I only want : <div class="head"> Which contains : Shmoo (Fighter) (Lvl: 13) And after that I'm going to parse it to find Lvl: x and make X into a variable... Is this even doable? Hahaha sounds crazy now that I think of it Edited November 7, 2007 by Shonnie Link to comment Share on other sites More sharing options...
DaleHohm Posted November 7, 2007 Share Posted November 7, 2007 $oDiv.classname gives you the class value. Don't know what Lvl: X is -- it's not in what you posted. You'll need to go to MSDN to find more info on properties of Div (see my sig, start with DHTML Objects link). 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...
Shonnie Posted November 8, 2007 Author Share Posted November 8, 2007 Oh, by Level: X, I meant whatever level the character is (In this case 13) I looked around the forums, and saw _StringSplit, so I tried it with no luck, but am continuing to search around 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