Jump to content
Sign in to follow this  
daan

getting tag element style

Recommended Posts

daan

hi all,

I'm trying to get element style from a tag like this:

<div class="B1" style="background: url(&quot;picture.gif&quot;) 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

Share this post


Link to post
Share on other sites
GEOSoft

$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!"

Share this post


Link to post
Share on other sites
PsaltyDS

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.

:idea:


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
DaleHohm

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

Share this post


Link to post
Share on other sites
daan

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

this wil do the trick, thanks all for a reply :idea:

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.