Sign in to follow this  
Followers 0
computergroove

Changing a span class to a new value with _IE functions

6 posts in this topic

#1 ·  Posted (edited)

I have this dropdown box in html code:

<a tabindex="0" title="" class="nsg-form--drop-down--label nsg-grad--light-grey nsg-form--drop-down exp-pdp-size-dropdown exp-pdp-dropdown selectBox-dropdown">
            <span class="js-selectBox-label">SIZE </span>
            <span class="js-selectBox-value nsg-form--drop-down--selected-option">&nbsp;</span>
          </a>

When I click on an option in the dropdown box and select the (10) it looks like this:

<a tabindex="0" title="" class="nsg-form--drop-down--label nsg-grad--light-grey nsg-form--drop-down exp-pdp-size-dropdown exp-pdp-dropdown selectBox-dropdown">
            <span class="js-selectBox-label">SIZE </span>
            <span class="js-selectBox-value nsg-form--drop-down--selected-option">(10)</span>
          </a>

The only thing that changes is the third line from &nbsp; to (10). I want my script to change the value.

I am thinking that _IEPropertySet is the function to use but what I am trying isn't working. Any help is appreciated.

Edited by computergroove

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites



Posting what you've attempted is helpfull...which property were you attempting to set...which object were you attempting to set it on?

Get you span, and attempt to modify the _IEPropertySet 'innertext'.


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

#3 ·  Posted (edited)

I've tried so many modifications that it would be hard to show you my script.

Get you span, and attempt to modify the _IEPropertySet 'innertext'.

 

 

So I need to set the span class name to a variable and insert into a _IEPropertySet($oIE,"innertext","(10)"). Ill try it.

*Edit - that didn't work.

Edited by computergroove

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

You can't use the WHOLE DOM object, and expect YOUR element to be updated...you have to get your specific object and then update it with _iepropertyset.

Loop through this, until your find your span:

$oSpans = _IETagNameGetCollection($oIE, "Span")

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

#5 ·  Posted (edited)

$oSpans = _IETagNameGetCollection($oIE, "Span")
For $i = 1 To 407
    MsgBox(0,$i,$oSpans)
Next

This only sends blank message boxes. Can I see the names in a message box for these?

Is it possible that the span class object has no tag? Like it's blank?

Edited by computergroove

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

You are not using anything in what you provided correctly.

Did you look at the helpfile?  There are samples there...

Did you do a forum search for that particular function?  There are samples there...


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

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