Use browser.link(:text, 'Chelsea Groves Business Cards').parent.click
----- Original Message ---- From: Natasha <itsn...@yahoo.co.uk> To: Watir General <watir-general@googlegroups.com> Sent: Tuesday, December 16, 2008 3:56:09 AM Subject: [wtr-general] Need help in accessing an element Hello All, Please could someone help me with a way to access a link element. Following is the HTML snippet: <DIV> <A><IMG></IMG><A> <P><A> Chelsea Groves Business Cards</A> </P> <P class=pBy> by Chelsea Groves </P> <DIV> I need to click on the link with text "Chelsea Groves Business Cards". But following is what I actually want to do. I want to click the link before the P tag having text ' by Chelsea Groves', rather then simply clicking on link having text ' Chelsea Groves Business Cards'. Thanks, Natasha --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~----------~----~----~----~------~----~------~--~---