Jump to content
UBot Underground

"Click" on a href within a div

Recommended Posts



I have a little a problem.

I am trying to click on a link <a href="*"> within a <div class="MYDIV"> .


The problem is that there are few <div class="**Something**"> ... <a href="*"> on the page.


The <a> has not class or id.


I want to click on the first  <a href="*"> within the wrapper <div class="MYDIV">.


Can someone help me on this one ?


Thank you,

Link to post
Share on other sites

If it is always the first one then use element offset, and then you can choose tagname a and then use 0 for the number (in programming 0 usually refers to the first of something).

  • Like 1
Link to post
Share on other sites

Thank you for your response :)


I preg matched the html to find the value of the href that I wanted.

But in the same div there were few href with the same value.

To only click on the first one I followed your advise:



click($element offset(<a,href="http://{#domain_content}">, 0), "Left Click""No")


Thank you again,

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.

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.

  • Create New...