Hello, I am working on a bot that would go to youtube and would pick 5-10 random channels every time it runs. This is my code.
<script>
//code to open youtube
window.open("YouTube");
//code to select the first 5 channels
let channels = document.querySelectorAll("ytd-guide-channel-renderer");
let firstFiveChannels = channels.slice(0,5);
//loop through the 5 channels and print out their titles
firstFiveChannels.forEach(function(channel){
console.log(channel.querySelector("#channel-title").innerText);
})
</script>
<script>
//code to open youtube
window.open("YouTube");
//code to select the first 5 channels
let channels = document.querySelectorAll("ytd-guide-channel-renderer");
let firstFiveChannels = channels.slice(0,5);
//loop through the 5 channels and print out their titles
firstFiveChannels.forEach(function(channel){
console.log(channel.querySelector("#channel-title").innerText);
})
</script>