Sign in to follow this  
Followers 0
longphant

IE: Print style of textbox

3 posts in this topic

#1 ·  Posted (edited)

Hi,

I am on a website where I can run searches. I input some parameters, and click the Search button. A text box then appears which says "Updating". It then disappears when the results are ready. Then it shows the results. I am trying to automate some scripts to run several searches and record them. _IELoadWait() does not work because it doesn't actually load a new page. Every time I hit the search button, it just pops up the "Updating" box, then shows me the results.

Thus, my solution is to search for the "Updating" box. In this case, the text box always exists; it is simply hidden or visible. The tag for the "Updating" textbox is a "div". While inspecting the element, I found It has a "style" attribute. When hidden, it shows "style=display: none;". When the textbox is visible, "style=display: block;". So given this, I can simply just wait for the style to become "display: none;" before proceeding. The only problem is...i can't seem to access this attribute. $tag.style is blank. $tag.getAttribute("style") is also blank.

Does anyone know how I can access this attribute? It seems to be the only way I can determine when the results are ready. (without pixel detection).

Here's how it looks like inspecting the element.

<div id="uB" style="display: none;">
<h1>Updating</h1>
<img src="/skins/loader.gif" alt="loader">
</div>
Edited by longphant

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

There are ways with the _ie* udf, but personally, for all my browser automation, I use the first line in my signature.

You can grab the div by the xpath, and then, when it's found, you can wait until it's no longer present, or wait for the new object to be present that states it's not displayed.

That's the long story, short story: to grab the style attribute is $style = $oObject.style.csstext

Where $oObject is your dom object for the div.

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

Thank you very much sir.

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  
Followers 0