NGINX社区官方微服务训练营,深入了解K8s网络,线上课程+专家答疑,立即加入>>>
用的是QT集成的浏览器,我想用脚本实现点某个按钮的操作,只是到taobao这“评论”的按钮怎么也打不开~taobao中任何一个商品页,都有这么个按钮
在WEBKIT中手动去点是可以的~但是用脚本去点就是点不开,不知道为什么~现附上部分脚本如下,
var count=0; function location() { scroll(0, 1000); var tabbar = document.getElementById("J_TabBar"); if (tabbar === null) { //未加载完,循环测试5次,如果5次都没有加载出来,就认为是商品不存在页面,跳到下一个地址 if((count++)>5) { ww.endOfPage(); return true; } setTimeout("location()", 1500); } else { var aset = tabbar.getElementsByTagName("a"); for ( var i = 0; i < aset.length; i++) { if (aset[i].getAttribute("data-index") === 1 && aset[i].href.indexOf("#reviews")!==-1) { simulate(aset[i], "click"); break; } } setTimeout("init()", 2000); } }