Given the following code:
<div class="parent">
<div class="child">3</div>
</div>
let parent = document.querySelector('.parent');
let child = parent.querySelector('.child')
let strParent = parent.outerHTML.toString()
let strChild = child.outerHTML.toString()
let indexOfChild = strParent.indexOf(strChild)
now that I have the index of the child inside stringified HTML how can I convert that to a DOM path (xpath/css selector)
Sorry if that's not 100% clear, English is not my first language.