Question: what is the main difference between xpath and css selectors?
Answer: Locating Element Using XPATH Selectors One of the important differences between XPath and CSS is, with XPath we can search elements backward or forward in the DOM hierarchy while CSS works only in a forward direction. This means that with XPath we can locate a parent element using a child element.