Michael Durrant
Michael Durrant

Reputation: 96454

how to change this xpath expression to css for selenium

I've been using xpath a lot recently.

Now I'm going to start using css a lot, based on advice I've received.

How would I take an xpath expression like

//tr[td[contains(.,'6 Day')]][1]/td[8]/a@href 

and convert it to css?

I tried

tr.td:contains('6 Day'):nth(1) > td:nth(3) > a[href]

but I got an error

Upvotes: 0

Views: 77

Answers (1)

Michael Durrant
Michael Durrant

Reputation: 96454

Minor mistake, I should have had:

tr td:contains('6 Day'):nth(1) > td:nth(3) > a[href]

Upvotes: 1

Related Questions