Roxanne_Ritchi

The button is not pressed.

13 posts in this topic

Hello, help to press the button, please.

<button class="bali-button bali-button_type_green bali-button_call_put bali-button_call" data-reactid=".0.0.0.0.3.0.0.0.1.1.0.1.1.0"><span class="bali-button__ico" data-reactid=".0.0.0.0.3.0.0.0.1.1.0.1.1.0.0"></span><span class="bali-button__label" data-reactid=".0.0.0.0.3.0.0.0.1.1.0.1.1.0.1"><span class="" data-reactid=".0.0.0.0.3.0.0.0.1.1.0.1.1.0.1.0">Выше</span></span></button>

Does not work

$oIE = _IEAttach ("Платформа")
Sleep(1000)
$oLinks = _IETagNameGetCollection ($oIE, 'button')
For $oLink in  $oLinks
   If $oLink.InnerText == 'Ниже' Then
      _IEAction ($oLink, 'click')
   EndIf
Next

 

Share this post


Link to post
Share on other sites



Run your code in Scite and post the complete results from the output window. Also, your code doesn't match the posted HTML (Выше vs Ниже).

Share this post


Link to post
Share on other sites

Thanks, I need to press "ВЫШЕ" or "НИЖЕ"
Still here such variant

#include <Array.au3>
#include <IE.au3>

Local $aIe[0], $oIe = _IECreate("https://alpari.com/ru/binary_options/binary_trader/")
$oCol = _IETagNameGetCollection($oIe, 'button')
For $oIn In $oCol
    $iUb = UBound($aIe)
    ReDim $aIe[$iUb + 1]
    $aIe[$iUb] = $oIn.classname
    If $aIe[$iUb] == "bali-button bali-button_type_orange bali-button_call_put bali-button_put" Then _IEAction($oIn, 'click');

Next
_ArrayDisplay($aIe, 'ma:')

Errors in the console are not present

Share this post


Link to post
Share on other sites
4 hours ago, Danp2 said:

Run your code in Scite and post the complete results from the output window.

@Roxanne_Ritchi This information could still be useful, even if it doesn't contain errors.

Can you provide a URL for the site?

Share this post


Link to post
Share on other sites

@Danp2 Not to bother you, but take this one from _IECreate()?


SciTE = 3.6.2.0/full   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win7Pro SP1   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE   H:\...\AutoIt3   H:\...\AutoIt3\Include   H: = Network Drive

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Share this post


Link to post
Share on other sites
47 minutes ago, Danp2 said:

@Roxanne_Ritchi Эта информация может быть полезной, даже если она не содержит ошибок.

>"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\Administrator\Desktop\alp v.7 3 09.au3"    
>Exit code: 0    Time: 22.1

 

49 minutes ago, Danp2 said:

Can you provide a URL for the site?

https://alpari.com/ru/binary_options/binary_trader

Share this post


Link to post
Share on other sites

@Simpel Good catch. I didn't notice that in the revised code. :-)

Share this post


Link to post
Share on other sites

@Roxanne_Ritchi The site uses the React javascript library, which makes if more difficult to automate with Autoit.

Share this post


Link to post
Share on other sites

The text is wrapped inside <span> tags, not <button>. So innertext should also contain the span tags, try this:

$oIE = _IEAttach ("Платформа")
Sleep(1000)
$oLinks = _IETagNameGetCollection ($oIE, 'button')
For $oLink in  $oLinks
   If StringInStr($oLink.InnerText, "Ниже") <> 0 Then
      _IEAction ($oLink, 'click')
   EndIf
Next

 


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

#10 ·  Posted

7 hours ago, TheDcoder said:

The text is wrapped inside <span> tags, not <button>. So innertext should also contain the span tags

Are you sure? I believe that is only true of innerHTML.

Share this post


Link to post
Share on other sites

#11 ·  Posted

58 minutes ago, Danp2 said:

Are you sure? I believe that is only true of innerHTML.

Ah! Yes, that might be true.


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

#12 ·  Posted

17 hours ago, Danp2 said:

@Roxanne_Ritchi The site uses the React javascript library, which makes if more difficult to automate with Autoit.

Thanks, difficult or it is impossible to make it in Autoit? 

You know a way to press this button?

Share this post


Link to post
Share on other sites

#13 ·  Posted

Pressing the button isn't the issue. Your existing code is likely pressing the button. However, it isn't triggering the onClick event for the React element. You may want to try with IUIAutomation to see if that works.

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