使用 console.log 时,是否可以在浏览器控制台中隐藏输出为 VMxxxx:x(userscript.html) 的次要文本正文?

When using console.log, is it possible to hide the secondary body of text that outputs as VMxxxx:x(userscript.html) in the browser console?

我通常需要复制输出并保存到一个文件,但我必须 delete/replace 第二个主体,因为它会输出我要求的任意多行。

 myStuffData                           userscript.html?id=54de63cd-70fe-4251-a060-10bb80d193d8:32

有没有办法通过以不同的方式输出文本来解决这个问题?这是我正在测试的代码。


function poo() {
    const myStuff = document.getElementsByClassName("itg gld");
    var elemCount = myStuff[0].childElementCount;
    myStuff[0].children.item(0).children[0];
    console.clear();
    for (let i = 0; i < elemCount; i+=1) {
    console.log (myStuff[0].children.item(i).children[0].href)}
}

这是我的意思的图片:https://i.imgur.com/6xGQofI.png

当然可以。您可以将单个输出传递给 console.log,用输入分隔行:

var myOutput = [];
for (let i = 0; i < 10; i++) myOutput.push(i);
console.log("\n" + myOutput.join("\n"));