Jump to content

Internet Explorer Click on a Button -without clear references-


Recommended Posts

I am trying to click on the first  "view details" button at the website below:

https://www......

image.png.14c5e9bba507c070e1ef5c53d0b8218f.png

I would like to try the way I found at this post (I don't know if it is the best way)

 

but I am not able to locate the button by ID or name. 

I have tried: Local $oForm = _IEGetObjByName($oIE, "View Details")

but it didn't work [ it gives me 0 (zero) in MsgBox], probably because there are several  with the same name in the same page and I couldn't find a way to identify ID.

Also _INetGetSource didn't help

How can I find out the property of this specific first button?

Thanks

 

 

Edited by Epulone
Link to comment
Share on other sites

There is 2 clear identification possibilities for you to use with tagname div :

<div class="btn btn-primary btn-sm font-sm property-details-button">View Details</div>

.className = "btn btn-primary btn-sm font-sm property-details-button" or .innerText = "View Details"

Just use _IETagNameGetCollection with div, and scan the collection for one of those 2 identificators...

 

Edit : Since there is a lot of div tags, I would recommend you to use "a" tag instead and then use the .firstElementChild to access that specific button...

Edited by Nine
Link to comment
Share on other sites

I have tried to learn more about how to use jQuery in Autoit but it seems to advanced for me. I would like to learn but I was not able to find a place to start.

When you have a moment could you please give me more details in how to use it with autoit? Or a good place to start?

Thanks

Link to comment
Share on other sites

The place to start would be the link I previously posted. Copy the contained code and try running it. This should give you the basics on how jQuerify works.

Beyond that, I posted a line of code above that should work to click the button you indicated you wanted to click. Try running it and let us know if it works. If it doesn't, come back and show us your code and also the results from the Scite output window.

Link to comment
Share on other sites

  • 4 weeks later...

I solve the problem using:

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

 

Global $oIE = _IECreate ("https://www........")
Local $oSpans = _IETagNameGetCollection($oIE, "div")
For $oSpan In $oSpans
    If $oSpan.className = 'btn btn-primary btn-sm font-sm property-details-button' Then
        _IEAction($oSpan, "click")


    ExitLoop
 EndIf

Thank you

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...