Jump to content
UBot Underground

How To Select Only First Element On Page


Recommended Posts

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

Link to post
Share on other sites

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"
  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...