get a selector (CSS/XPATH) from a given DOM object