in reply to From a given text Extract the root HTML element inner text

Using XML::XSH2:
open :F html 1.html ; cd //text()[.="AAAAAA"] ; ls ancestor::div[1] ;
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ