Сообщение от mik888em
|
Пытаюсь с помощью XPATH запроса
|
Как вариант...
<a
id="video-title"
class="yt-simple-endpoint style-scope ytd-video-renderer"
title="Best songs to boost your mood ~ Chill vibes ???? Chill out music mix playlist"
href="/watch?v=E4KMnaOF7lU"
aria-label="Best songs to boost your mood ~ Chill vibes ???? Chill out music mix playlist by Chilled Feelings 14 hours ago 56 minutes 42,032 views"
>
Test
</a>
<script>
const o = document.evaluate('//a[@id="video-title"] ', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null );
const arr = []
arr.push(o.singleNodeValue.title)
arr.push(o.singleNodeValue.href)
arr.push(o.singleNodeValue.ariaLabel)
alert(arr.join('\n'));
</script>