1

There is a type of XPath like this

//div[span[a[@title='foo']]]

where it matches & returns the div (not the hyperlink) that contains a span, which in turn contains a hyperlink with title "foo".

is there a CSS selector format equivalent to this?

I gave it a short trying to convert to CSS, and if there is an equivalent, I don't know how to map it correctly.

BoltClock
  • 630,065
  • 150
  • 1,295
  • 1,284
David
  • 2,699
  • 2
  • 25
  • 40

1 Answers1

2

No, there isn't. Selectors don't have the kind of predicate that XPath does, and there isn't a way to ascend an element's hierarchy from the deepest element (in this case your a[@title='foo']), i.e. there is no parent selector.

Community
  • 1
  • 1
BoltClock
  • 630,065
  • 150
  • 1,295
  • 1,284