I need to retrieve text from inner element. With php it so easy to use Xpath. how about in javascript? I need to retrieve from specific element with specific id too. the request under code below. Let say it doesnt problem with CORS. i installed chrome extension to solve CORS.
<html>
<head>
</head>
<body>
<script>
fetch('https://alexistogel1.blogspot.com/2019/08/post-tak-penting.html')
.then(function (response) {
return response.text();
})
.then(function (html) {
var element = document.evaluate( "//div[@id='post-body-6034358444211110141']" ,document, null, XPathResult.ANY_TYPE, null );
console.log(element);
});
</script>
</body>
</html>
document.evaluatebehtml?