Jump to content
Roxanne_Ritchi

The button is not pressed.

Recommended Posts

Roxanne_Ritchi

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
Roxanne_Ritchi

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
Simpel

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


SciTE4AutoIt = 3.7.3.0   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
Roxanne_Ritchi
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
TheDcoder

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
TheDcoder
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
Roxanne_Ritchi
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
Danp2

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

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.