以下代码:
function(){
var re = [];
document.querySelectorAll("#RightExam li > a:nth-child(2)").forEach(function(item){
var obj = {"title":item.textContent.replace(/^\s*\d+、\s*(\S+)。[\w\W]+$/m,"$1"),"option":item.querySelector("div").textContent.replace(/[ABCD\s、]+/mg,"\|")};
re.push(obj);
});
return re;
}
网址:http://train.lnsafety.com/mnzxks/index1.html
浏览器运行结果:
UB运行结果