get the xpath/selector of the selected node and offset