I am trying to find a way to get any parent (or child) element in HTML structure that is loaded into string by index. Keep in mind that string index is all I have. No tag name, class or id.
Supposes I have following stored in html variable, but the html would be usually much more complicated :
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
Now I would like to be able to get something like following:
body > h1
Using something like html[63]
The problem here is that user can add any index number they want. So for example index number inside tag itself.
Right now I am using CodeMirror 6 for retrieving the string index by clicking into form if that helps.


