Roxanne_Ritchi Posted September 3, 2017 Share Posted September 3, 2017 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 Link to comment Share on other sites More sharing options...
Danp2 Posted September 3, 2017 Share Posted September 3, 2017 Run your code in Scite and post the complete results from the output window. Also, your code doesn't match the posted HTML (Выше vs Ниже). Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Roxanne_Ritchi Posted September 3, 2017 Author Share Posted September 3, 2017 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 Link to comment Share on other sites More sharing options...
Danp2 Posted September 3, 2017 Share Posted September 3, 2017 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? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Simpel Posted September 3, 2017 Share Posted September 3, 2017 @Danp2 Not to bother you, but take this one from _IECreate()? SciTE4AutoIt = 3.7.3.0 AutoIt = 3.3.14.2 AutoItX64 = 0 OS = Win_10 Build = 19044 OSArch = X64 Language = 0407/german H:\...\AutoIt3\SciTE H:\...\AutoIt3 H:\...\AutoIt3\Include (H:\ = Network Drive) Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. Link to comment Share on other sites More sharing options...
Roxanne_Ritchi Posted September 3, 2017 Author Share Posted September 3, 2017 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 Link to comment Share on other sites More sharing options...
Danp2 Posted September 3, 2017 Share Posted September 3, 2017 @Simpel Good catch. I didn't notice that in the revised code. :-) Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Danp2 Posted September 4, 2017 Share Posted September 4, 2017 @Roxanne_Ritchi The site uses the React javascript library, which makes if more difficult to automate with Autoit. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
TheDcoder Posted September 4, 2017 Share Posted September 4, 2017 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 EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
Danp2 Posted September 4, 2017 Share Posted September 4, 2017 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. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
TheDcoder Posted September 4, 2017 Share Posted September 4, 2017 58 minutes ago, Danp2 said: Are you sure? I believe that is only true of innerHTML. Ah! Yes, that might be true. EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
Roxanne_Ritchi Posted September 4, 2017 Author Share Posted September 4, 2017 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? Link to comment Share on other sites More sharing options...
Danp2 Posted September 4, 2017 Share Posted September 4, 2017 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. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now