selkiss 0 Posted May 20, 2013 Report Share Posted May 20, 2013 Hi, 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, Quote Link to post Share on other sites
HelloInsomnia 1103 Posted May 20, 2013 Report Share Posted May 20, 2013 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). 1 Quote Link to post Share on other sites
selkiss 0 Posted May 20, 2013 Author Report Share Posted May 20, 2013 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, 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.