When I try to print elements found by function, just the first one is being printed.
Tried multiple printing methods. For now alert() is working fine, but I can't copy the content.
function test() {
var x = document.getElementsByClassName("but b_yt");
for (i = 0; i < x.length; i++) {
alert(x[i]);
}
}
Every other printing methods doesn't print at all, prints just first one or something like [HTML Data Collection]. console.log works, but it gives me the whole HTML code of button.

alert()will stop any further execution until you click "ok" on dialoguexto[...document.getElementsByClassName("but b_yt")], it will spread the HTML data collection into an array of elements