MJ36 Posted January 10, 2019 Share Posted January 10, 2019 (edited) Hey, I would need help targeting in learning how to click a diva object, etc. I would like to refer to this text is it possible to refer to text or data words? If so, please help me hint what to read to learn it. This is just an example of what I mean Edited January 16, 2019 by MJ36 Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted January 10, 2019 Share Posted January 10, 2019 @MJ36 Take a look at _IE* functions in the Help file 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...
MJ36 Posted January 10, 2019 Author Share Posted January 10, 2019 (edited) and on which exactly? Edited January 10, 2019 by MJ36 Link to comment Share on other sites More sharing options...
caramen Posted January 10, 2019 Share Posted January 10, 2019 (edited) All of them will be good for you if you want to "learn" Also you can try search by keywords in the HelpFile : Search tab. Or Sumary Tab > User Defined Function > IE Management _IELinkClickByText To unswer more to the question. I would suggest you to use the "Class" I would do that with WebDrivers. I dont really know the syntax with _IE functions but it should work. Anyway if you show us what you tryed, that will allow us to give you more specific help. Look my avatar Edited January 10, 2019 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
MJ36 Posted January 10, 2019 Author Share Posted January 10, 2019 #include <IE.au3> Local $oIE = _IECreate("konsalnet.pl") _IELoadWait ($oIE) Local $sMyString = "Wideo weryfikacja alarmów z obiektu i wideo analityka" Local $oLinks = _IELinkGetCollection($oIE) For $oLink In $oLinks Local $sLinkText = _IEPropertyGet($oLink, "innerText") If StringInStr($sLinkText, $sMyString) Then _IEAction($oLink, "click") ExitLoop EndIf Next ok, I was editing the code above and working. But that's not what I meant exactly In the current situation, autoit clicks on the diva because there is a text in it that is in the link in the div in the case of a diva with a link in which the text does not have a word, the program does not click it. Link to comment Share on other sites More sharing options...
Danp2 Posted January 10, 2019 Share Posted January 10, 2019 Since the example site you picked doesn't exactly show what you are trying to do, perhaps you could provide a better example so that we are clear on your requirements. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Subz Posted January 10, 2019 Share Posted January 10, 2019 If you don't have text then, you need to identify the div, either by name, id or class name attributes, you may even have to select an element before it and use next/previous sibling. Example: #include <IE.au3> Local $oIE = _IECreate("konsalnet.pl", 1) _IELoadWait ($oIE) ;~ You would normally just use _IEGetObjById($oIE, "contact-form-btn") but just showing how to use h3 collection Local $oH3s = _IETagNameGetCollection($oIE, "h3") For $oH3 In $oH3s If $oH3.id = "contact-form-btn" Then ;~ Get the innertext from the div before the h3 tag ConsoleWrite($oH3.PreviousSibling.InnerText & @CRLF) EndIf ;~ Or you could use class name of the h3 tag as an identifier ;~ nb: Class names are generally not recommended unless you know that is the only H3 Tag with that class name. If $oH3.ClassName = "formularz-rozwin" Then ExitLoop _IEAction($oH3, "click") Next robertocm and MJ36 1 1 Link to comment Share on other sites More sharing options...
MJ36 Posted January 15, 2019 Author Share Posted January 15, 2019 @Subz Thank you for help, I'm beginning to understand it I still have a last question. If I had a few the same H3 tags with the same class name $oH3.ClassName = "formularz-rozwin" Can I somehow give you a hint that the program would click eg in the third same tag ? Link to comment Share on other sites More sharing options...
Subz Posted January 15, 2019 Share Posted January 15, 2019 First find out what the index number is of the H3 object using the following code: #include <IE.au3> Local $oIE = _IECreate("konsalnet.pl", 1) _IELoadWait ($oIE) Local $oH3s = _IETagNameGetCollection($oIE, "h3") For $i = 0 To ($oH3s.Length - 1) ConsoleWrite("H3 Tag " & $i & ": " & $oH3s($i).InnerText & @CRLF) Next Once you know the index of the object you can use something like: #include <IE.au3> Local $oIE = _IECreate("konsalnet.pl", 1) _IELoadWait ($oIE) Local $oH3s = _IETagNameGetCollection($oIE, "h3") Local $oH3 = $oH3s(1) ;~ Formularz kontaktowy H3 tag _IEAction($oH3, "click") MJ36 and robertocm 1 1 Link to comment Share on other sites More sharing options...
MJ36 Posted January 16, 2019 Author Share Posted January 16, 2019 Thank you very much for your help 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