问题描述
我想创建一个Web应用程序,我想自动点击网页中的所有链接。在页面中,假设存在25个链接。所以需要打开所有25个链接。
因为我无法单击所有链接!请分享您的想法和处理意见。
任何帮助都会被评估..
I wanted to create a web aplication where i want to click all links in a webpage automatically. Like in a page assume 25 links exists. So need to open all 25 links.
As I am unable to click all the links in a single shot!! kindly share your idea and views on processing.
Any help will be appriciated..
推荐答案
function allLinks()
{
var anchors=document.getElementsByTagName("a");
for(var i =0;i<anchors.length;i++)>
{
window.open(anchors[i].href,"_blank");
}
}
我没有尝试过它第一次面对这样的问题但我觉得它应该工作,这里锚点是页面和窗口上所有超链接的数组.open()函数用于打开一个窗口。你可以调用这个功能在你的网页结尾处
如果你不了解javascript那么我建议你学习它
祝你好运
Well I did`t Try It Its First Time For Me To Facing Problem Like This But I think It Should Work, Here anchors is array of all hyperlinks on Page and window .open() function is used for open a window. and you can call this function At the end of your web page inside the
If you don`t know about javascript then i suggest you to learn It
Good luck
这篇关于如何使用asp.net单击页面上存在的所有链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!