我试图点击 JS 网站上显示的一些文本。显示的文字是“Supreme®/Vanson Leathers® Worn Leather Jacket”。我的代码是:
const readline = require('readline-sync');
const {exec} = require("child_process")
function cmdCommand(cmd){
exec(cmd, (error, stdout, stderr) => {
if (error) {
console.log(`error: ${error.message}`);
return;
}
console.log(`Utilizing the quantum: ${stdout}`);
});
}
const reader = require("readline-sync");
let answer = reader.question("1,2,3,4,5,or 6?: ");
answer === "1"? cmdCommand("start chrome https://www.supremenewyork.com/shop/all/jackets",
function myFunction() {
document.getElementById("Supreme®/Vanson Leathers® Worn Leather Jacket").click();
}
):""
我正在使用 readline-sync 来选择一系列选项,选项 1 启动网站,但我不知道如何单击文本。
森栏
相关分类