我的目标是每隔一段时间刷新和监视网页,并单击出现的任何新链接。就像出价狙击机器人的对立面?
我有很短的经验,可以用吗?我可以进行刷新,没有问题,但具体的元素单击是我所不知道的。
如果已经有了答案,我很抱歉。我肯定是这样的,这是SO.If,你可以带我找到正确的材料,我会非常感激的。
我试着搜索,但甚至不知道该找什么。我发现了一些关于ajax的东西,但不确定这是否对我有帮助。
发布于 2015-07-28 13:21:16
您可能想看看硒。它允许您对浏览器进行相当广泛的自动化。除非我没有正确理解你的问题,否则它会为你提供你想要的功能。
发布于 2015-07-28 13:33:47
你想要捕捉数据,对吗?好的,这有点困难,因为你想收集一些数据,然后你想看到结果。首先,让我们创建一个收集数据的函数:
var x=0; //let's see how many clicks...
var y=[]; //let's see what is clicked
function collect(id){ //id is an argument...
x++;//let's increase our variable counter...
y.push(document.getElementById(id).href); //href is the link of the a element,the link in poor words...
}
function Show(){//let's show the result
alert(y.toString());//This is the result of the data collect by the array y
}好的,让我们把这个放在一个小例子中
<html>
<body>
<a href="http://www.github.com" onClick="collect();show();">1 link</a>
<a href="http://www.stackoverflow.com" onClick="collect();show();">2 link</a>
<a href="http://www.google.com" onClick="collect();show();">3 link</a>
</body>
</html>这是你的主意吗?
https://stackoverflow.com/questions/31677466
复制相似问题