Chezzyk 0 Posted January 13, 2017 Report Share Posted January 13, 2017 Hello, I'm trying to click on element that shows many times on the page and they are all same. I use "innertext" as selector nad I would like the selcet always only the first such element on page. Can someone give me any idea how to do this? Thanks for help Quote Link to post Share on other sites
Macster (UBotter Labs) 112 Posted January 13, 2017 Report Share Posted January 13, 2017 Use the $element offset parameter inside the click command. See the wiki how to better use it for your case. [uBotter Labs] Quote Link to post Share on other sites
Chezzyk 0 Posted January 13, 2017 Author Report Share Posted January 13, 2017 I tried it, but did not understand how to select first occurence of some element on page. Quote Link to post Share on other sites
HelloInsomnia 1103 Posted January 13, 2017 Report Share Posted January 13, 2017 You would use element offset and set the offset to be 0 to select the first element, here is an example of how to select the innertext for the first h3 tag on a page: set(#text,$scrape attribute($element offset(<tagname="h3">,0),"innertext"),"Global" 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.