Jump to content

Recommended Posts

Posted

The ID didn't change while I was trying. And there are three refresh buttons in your page. Third refresh button is the one in the Zlecnia (don't know what it means). 

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

Local $aRefreshButtons[0] ;there are three refresh buttons in your page
$oIE = _IECreate("https://www.supermakler.pkobp.pl/plus/demo/")
_IELoadWait($oIE)

$oDivs = _IETagNameGetCollection($oIE, "div")
For $oDiv In $oDivs
    If $oDiv.id <> "" And $oDiv.classname = " x-nodrag x-tool-refresh x-tool epm-toolButton x-component " Then
        ConsoleWrite($oDiv.id & " - " & $oDiv.className & @CRLF)
        _ArrayAdd($aRefreshButtons, $oDiv.id)
    EndIf
Next
_ArrayDisplay($aRefreshButtons)

$oRefreshButton = _IEGetObjById($oIE, $aRefreshButtons[2]) ;your refresh button is always the third
_IEAction($oRefreshButton, "focus")
If _IEAction($oRefreshButton, "click") Then
    ConsoleWrite("OK" & @CRLF)
    _IELoadWait($oIE)
Else
    ConsoleWrite("NOK" & @CRLF)
EndIf

;_IEQuit($oIE)

I'm sure there is a better way to solve this and I would learn the easier way too. 

TY.

Posted

Another method:

#include <IE.au3>
$oIE = _IECreate("https://www.supermakler.pkobp.pl/plus/demo/", 1)
$oDivs1 = _IETagNameGetCollection($oIE, "Div")
For $oDiv1 In $oDivs1
    If StringInStr($oDiv1.id, "x-auto-") Then
        If StringStripWS($oDiv1.innertext, 8) = "Zlecenia" Then
            $oDivs2 = _IETagNameGetCollection($oDiv1, "Div")
            For $oDiv2 In $oDivs2
                If StringStripWS($oDiv2.ClassName, 7) = "x-nodrag x-tool-refresh x-tool epm-toolButton x-component" Then
                    _IEAction($oDiv2, "Click")
                EndIf
            Next
        EndIf
    EndIf
Next

 

Posted (edited)
$nextstep = False
$oDivs1 = _IETagNameGetCollection($oIE, "Div")
For $oDiv1 In $oDivs1
    If StringInStr($oDiv1.classname, "epm-gadget-panel-edge-center") And StringStripWS($oDiv1.innertext, 8) == "Zlecenia" Then
        $nextstep = True
    EndIf

    If $nextstep == True And StringInStr($oDiv1.classname, "x-tool-refresh") Then
        _IEAction($oDiv1, "Click")
        $nextstep = False ;There are two "Zlecenia"
    EndIf
Next

There are two panes "Zlecenia" in tabs "Stan rachunku" and "Zlecenia", and I didn't use breakloop after first Click.

 

Edited by duzers
Posted

Isn't the other named "Zlecenia Online"?  If you wanted to target this you would need to use:
Note, flag 7 removes beginning and end spaces + double spaces.  flag 8 removes all white space.  Also you can use single = if you aren't worried about string case, otherwise == to match the string exactly.

StringStripWS($oDiv1.innertext, 7) = "Zlecenia Online"

 

Posted (edited)

Yes, there is "Zlecenia Online" but in the same tab. I used exactly comparison and it skipped "Zlecenia Online". Another "Zlecenia" is in tab "Stan rachunku" (look at the top of site). My code refresh all panes named "Zlecenia" but offcourse I can first check if it is in specific Tab.

Edited by duzers

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
  • Recently Browsing   0 members

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