Sunday, July 27, 2014

How get xpath or CSS for sibling elements

XPATH for Sibling

//div[@class='about-membership-card'][1]/span[contains(text(),'Plus | $100')][1]/following-sibling::a[1]

CSS
div[id='about-membership-wrapper']>div[class='about-membership-cards']:first-of-type>div[class='about-membership-card']:first-of-type>span+a:first-of-type

 Indexes in CSS
div[id='about-membership-
wrapper']>div[class='about-membership-cards']>div[class='about-membership-card']:nth-child(2)>span+a:nth-child(2)



No comments:

Post a Comment