SOURCE

var url = 'https://detail.tmall.com/item.htm?id=638005051622';
var temp2 = url.split('?')[1];
var pram2 = new URLSearchParams('?' + temp2);
q = pram2.get('id');
//console.log(q);
if (url.match(/tmall.com/gi)) {
    n="天猫";
    wurl="https://api09.99api.com/tmall/detail";
}
else if (url.match(/taobao.com/gi)) {
    n="淘宝";
    wurl="https://api09.99api.com/taobao/detail";
}
else if (url.match(/jd.com/gi)) {
    n="京东";
    wurl="https://api09.99api.com/jd/detail";
}
else if (url.match(/1688.com/gi)) {
    n="1688";
    wurl="https://api09.99api.com/1688/detail";
}
else {
    n="请检查采集网址是否正确";
}

//console.log(x);
if (n!="请检查采集网址是否正确"){
    console.log(n);
    console.log(wurl +'&itemid='+ q);
    console.log(q);
}
else {
    console.log(x);
    
}
console 命令行工具 X clear

                    
>
console