fetch('httрs://www.karoteka.ru/')
.then((re)=>{
return re.text()
})
.then((re)=>{
let doc = new DOMParser().parseFromString(re, "text/html");
let b = doc.querySelectorAll(".news_item .image_block_no_image p")[0].innerHTML;
console.log(b);
});
fetch('https://www.kartoteka.ru/')
.then((response) => response.arrayBuffer())
.then((buffer) => {
let html = new TextDecoder('windows-1251').decode(buffer);
let doc = new DOMParser().parseFromString(html, 'text/html');
let b = doc.querySelectorAll(".news_item .image_block_no_image p")[0].innerHTML;
console.log(b);
});
fetch('https://www.kartoteka.ru/').then(function(promise) {
return promise.blob();
}).then(function(file) {
var reader = new FileReader();
reader.readAsText(file, 'windows-1251');
reader.onload = function() {
var doc = new DOMParser().parseFromString(reader.result, 'text/html');
var b = doc.querySelectorAll(".news_item .image_block_no_image p")[0].innerHTML;
console.log(b);
};
});