在不是我的网站中,搜索结果
<a href="show?file=191719&token=r1j">
<a href="show?file=191720&token=gh5">
<a href="show?file=191721&token=98j">
.....
<a href="show?file=191733&token=ty0">
当我单击其中的一个后,我进入页面并填写表格,然后进入下载页面,然后单击链接:
<a href="download?file=191719&token=r1j">
而且我必须手动进行此操作,因为150个文件太长了!
我想要的是使用脚本或其他工具,我通过在结果页面中获取文件ID来直接下载所有文件,并将其放在下载链接中。
请使用此javascript代码段,http://www.that-website.com/
该网站的网址在哪里,并且如果文件太多,请勿一次下载所有文件,请通过指定开始和结束文件编号来每次下载数十个文件,请注意,浏览器弹出窗口阻止程序将阻止此操作因此您需要在浏览器的弹出窗口阻止程序中允许此网页弹出
JS:
var fileNumber,
start = 191719,
finish = 191729;
for(fileNumber = start; fileNumber <= finish; ++fileNumber){
window.open("http://www.that-website.com/download?file=" + fileNumber);
}
更新:由于随机令牌是在url中实现的,最简单的方法是在的多行中手动输入window.open()
,如下所示:
window.open("http://www.that-website.com/download?file=191719&token=r1j");
window.open("http://www.that-website.com/download?file=191720&token=gh5");
window.open("http://www.that-website.com/download?file=191721&token=98j");
以此类推。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<!-- COPY BUNCH OF THE URLs AND PASTE THEM IN HERE THEN RELOAD THE PAGE, THEN REPEAT OVER AND OVER UNTIL IT IS ALL DONE! -->
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script>
$(document).ready(function(){
$('a').each(function(){
var showLink = $(this).attr('href');
var downloadLink = showLink.replace("show?file", "download?file");
window.open("http://www.example.com/" + downloadLink);
});
});
</script>
</body>
</html>
使用上面的代码,这是您计算机上的HTML页面,从该网站页面链接中复制几个原始文件(例如:)<a href="http://www.example.com/show?file=111&token=23f">TEST</a>
到您的本地页面并运行它,仍然强烈建议您每次粘贴10-30个链接。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句