let element = document.querySelectorAll("p")[0];
element.innerHTML="new text";
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
const url = "//assets.pinterest.com/js/pinit.js"
const newScript = document.createElement("script")
newScript.setAttribute("async", "true")
newScript.setAttribute("defer", "true")
newScript.dataset.pinHover = "true"
newScript.dataset.pinTall = "true"
document.head.appendChild(newScript)
newScript.src = url
</script>
</body>
</html>
var options = {
root: document.querySelector('#scrollArea'),
rootMargin: '0px',
threshold: 1.0
}
var callback = function(entries, observer) {
/* Content excerpted, show below */
};
var observer = new IntersectionObserver(callback, options);
function bindActionCreator(actionCreator, dispatch) {
return function () {
return dispatch(actionCreator.apply(this, arguments));
};
}
function () {
return dispatch(actionCreator.apply(this, arguments));
};
camera-orbit="45deg 55deg 2.5m"
const cheerio = require('cheerio')
const xml = `
<offer internal-id="12345">
<living-space>
<value>31</value>
<unit>кв. м</unit>
</living-space>
<kitchen-space>
<value>11</value>
<unit>кв. м</unit>
</kitchen-space>
<image>https://example.website.yandexcloud.net/files/ycKZLv7B0GUZled.jpg</image>
<image>https://example.website.yandexcloud.net/files/ycKZLv7B0GUZled.jpg</image>
</offer>
`
async function main() {
try {
let $ = await cheerio.load(xml, {
xmlMode: true
})
let title = $('image').text()
console.log('title', title)
} catch (e) {
console.log(e)
}
}
main()
const endLine = '\r\n'; // если Windows
let lineArray = String( fs.readFileSync( 'price.txt' ) ).split( endLine );
// что-то делаем с полученными строками
// ...
let file = lineArray.join( endLine ) // соединяем обратно в целый файл
for (let i = 0; i < arr.length; i ++)