Jump to content

Recommended Posts

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

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

Posted

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.
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

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
×
×
  • Create New...