daan Posted May 12, 2010 Share Posted May 12, 2010 hi all, I'm trying to get element style from a tag like this: <div class="B1" style="background: url("picture.gif") top: 0px; left: 0px; border: 0px solid rgb(255, 255, 255); cursor: auto;" id="pass"> i have try to attach with _IEGetObjById($oIE, "pass") but the result was noting, so has anyone of you a solution thanks greets Daan Link to comment Share on other sites More sharing options...
GEOSoft Posted May 12, 2010 Share Posted May 12, 2010 $sStr = _IEBodyReadHTML ($oIE) $sStyle = StringRegExpReplace($sStr, "(?i)<div\sclass.+b1.+style=\x22(.+)\x22.+id=\x22pass\x22.+", "$1") George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 12, 2010 Share Posted May 12, 2010 Use a DOM inspector like DebugBar with IE, or Firebug with Firefox, to find out what the path to that element is. If it's inside some frames/forms/etc., you might have to get references to them first and drill down using for example _IEFormElementGetObjByName(). In addition, if it's inside a frame from another site, cross-site scripting protection wouldn't let you in anyway. 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...
DaleHohm Posted May 12, 2010 Share Posted May 12, 2010 If by "nothing" you mean that looking at the contents of _IEGetObjById($oIE, "pass") isn't what you expect, then realize that it returns a special data type called and object. Instead, try: $oPass = _IEGetObjById($oIE, "pass") ConsoleWrite(_IEPropertyGet($oPass, "outerhtml") & @CRLF) 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...
daan Posted May 13, 2010 Author Share Posted May 13, 2010 If by "nothing" you mean that looking at the contents of _IEGetObjById($oIE, "pass") isn't what you expect, then realize that it returns a special data type called and object.Instead, try:$oPass = _IEGetObjById($oIE, "pass")ConsoleWrite(_IEPropertyGet($oPass, "outerhtml") & @CRLF)Dalethis wil do the trick, thanks all for a reply 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