Zmylna Posted April 16, 2020 Share Posted April 16, 2020 Hi All :) I have read many posts, I have made many attempts but I could not click on the text :( The text I am trying to click on the page is "Reinstalacja komputera". Can anyone help me please? I've attached a screenshot of the FireFox debugger Thank you Link to comment Share on other sites More sharing options...
Zmylna Posted April 17, 2020 Author Share Posted April 17, 2020 Anyone please ? Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted April 17, 2020 Share Posted April 17, 2020 @Zmylna Post the code you are using, so we can see if there's something wrong there. Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Zmylna Posted April 17, 2020 Author Share Posted April 17, 2020 (edited) Hi Francesco. $sMName = "Reinstalacja Komputera" $oTable = _IETableGetCollection($oIE, 1) $oTds = _IETagNameGetCollection($oTable, "td") For $oTD In $oTds If String($oTD.innertext) = $sMName Then MsgBox(0, "", $oTD.innertext) _IEAction($oTD, "click") ExitLoop EndIf Next MsgBox shows "Reinstalacja komputera" but no click at all. Unfortunately it does not work Edited April 17, 2020 by Zmylna Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted April 17, 2020 Share Posted April 17, 2020 (edited) @Zmylna Can we have access to the website to help you out? Edited April 17, 2020 by FrancescoDiMuro Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Zmylna Posted April 17, 2020 Author Share Posted April 17, 2020 1 minute ago, FrancescoDiMuro said: @Zmylna Can we have access to the website to help you out? Unfortunately, this is the internal site of the company. It is not publicly available Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted April 17, 2020 Share Posted April 17, 2020 @Zmylna First, try to see if some function returns an error doing this: _IEFunction() If @error Then ConsoleWrite("An error occured with _IEFunction! ERR: " & @error & @CRLF) Exit Else ; Keep with the script EndIf Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Zmylna Posted April 17, 2020 Author Share Posted April 17, 2020 (edited) 14 minutes ago, FrancescoDiMuro said: @Zmylna First, try to see if some function returns an error doing this: _IEFunction() If @error Then ConsoleWrite("An error occured with _IEFunction! ERR: " & @error & @CRLF) Exit Else ; Keep with the script EndIf Francesco, sorry for stupid question but where exactly paste this code ? On the begining of the script ? Edited April 17, 2020 by Zmylna Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted April 17, 2020 Share Posted April 17, 2020 @Zmylna Always after the call of the function. In this case, after those three functions Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Zmylna Posted April 17, 2020 Author Share Posted April 17, 2020 expandcollapse popup$sMName = "Reinstalacja Komputera" $oTable = _IETableGetCollection($oIE, 1) ;### If @error Then ConsoleWrite("An error occured with _IEFunction! ERR: " & @error & @CRLF) Exit Else ; Keep with the script EndIf ;### $oTds = _IETagNameGetCollection($oTable, "td") ;### If @error Then ConsoleWrite("An error occured with _IEFunction! ERR: " & @error & @CRLF) Exit Else ; Keep with the script EndIf ;### For $oTD In $oTds If String($oTD.innertext) = $sMName Then MsgBox(0, "", $oTD.innertext) _IEAction($oTD, "click") ;### If @error Then ConsoleWrite("An error occured with _IEFunction! ERR: " & @error & @CRLF) Exit Else ; Keep with the script EndIf ;### ExitLoop EndIf Next No Errors in console. Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted April 17, 2020 Share Posted April 17, 2020 @Zmylna So the code is processed correctly. But it seems that you are looking in the wrong place (TD's instead of button_js's). I am not very familiar with JS, but you should be able to get a collection of those and search for the innertext of the button instead of the td. Give it a try Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Zmylna Posted April 17, 2020 Author Share Posted April 17, 2020 (edited) 36 minutes ago, FrancescoDiMuro said: @Zmylna So the code is processed correctly. But it seems that you are looking in the wrong place (TD's instead of button_js's). I am not very familiar with JS, but you should be able to get a collection of those and search for the innertext of the button instead of the td. Give it a try Understand. Can you tell me how to find "button_js" in this case ? I try to replace "td" with "button_js" but still nothing. Edited April 17, 2020 by Zmylna Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted April 17, 2020 Share Posted April 17, 2020 37 minutes ago, Zmylna said: I try to replace "td" with "button_js" but still nothing. You need to add another _IETagNameGetCollection() with button_js and not replace the td one, because the button_js is contained in a td element Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Zmylna Posted April 17, 2020 Author Share Posted April 17, 2020 14 minutes ago, FrancescoDiMuro said: You need to add another _IETagNameGetCollection() with button_js and not replace the td one, because the button_js is contained in a td element hmm. Something like this ? $sMName = "problem z poczta" $oTds = _IETagNameGetCollection($oIE, "td") For $oTD In $oTds If String($oTD.innertext) = $sMName Then ;============================================= $a= _IETagNameGetCollection($oTD, "button_js") for $n in $a msgbox(0,"",String($n.innertext)) Next ;============================================= MsgBox(0, "", $oTD.innertext) _IEAction($oTD, "click") ExitLoop EndIf Next Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted April 17, 2020 Share Posted April 17, 2020 @Zmylna Use the .Title property for the $n object Zmylna 1 Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Zmylna Posted April 17, 2020 Author Share Posted April 17, 2020 9 minutes ago, FrancescoDiMuro said: @Zmylna Use the .Title property for the $n object I am not very familiar with objects. Can you show my on my code please ? I will try to understand Link to comment Share on other sites More sharing options...
Zmylna Posted April 17, 2020 Author Share Posted April 17, 2020 OK, i got it ! This code works: $sMName = "problem z poczta" $oTds = _IETagNameGetCollection($oIE, "td") For $oTD In $oTds If String($oTD.innertext) = $sMName Then $a = _IETagNameGetCollection($oTD, "button_js") For $n In $a If String($n.innertext) = $sMName Then _IEAction($n, "click") ExitLoop EndIf Next ExitLoop EndIf Next Thank you Francesco Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted April 17, 2020 Share Posted April 17, 2020 @Zmylna Glad you got it working! Happy to have helped Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette 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