可以参考:http://bbs.aardio.com/thread-2087-1-1.html 很全面,详细
代码示例:
import web.mshtml; import console;
var wb = web.mshtml()
html = /** <div id="idTest" class="style2" node="node1"> 测试文本1 测试文本2 </div> </div> <div id="idTest2" class="style2" node="node2"> 测试文本3 </div> **/ wb.write(html)
qEles = wb.queryEles( ["node"] = ".+")
console.varDump( qEles )
for(k,v in qEles){ console.varDump( v ) //qEles中不是获取的值为空,而是是无法在控制台显示的数据类型
}
io.open(); io.print(qEles[1].getAttribute("node")); io.print(qEles[1].id); execute("pause") //按任意键继续 io.close();//关闭控制台
|
import web.mshtml; import console; var wb = web.mshtml() html = /** <div id="idTest" class="style2" node="node1" custom="test11"> 测试文本1 测试文本2 </div> **/ wb.write(html) qEles = wb.queryEles( ["node"] = ".+") io.open(); io.print(qEles[1].getAttribute("custom")); execute("pause") //按任意键继续 io.close();//关闭控制台
|