document.querySelector("div")
document.querySelectorAll("div")
$x("//div")
Get parent of a element
$x("//span/..")
Traverse to parent until element is found
$x("//*[@class="childClass"]//ancestor::div[@class='parentTargetClass']")
more at https://devhints.io/xpath