我有一个具有延迟加载功能的给定网站,当您向下滚动页面时,它会加载20个新项目。他们每个人都有一个下载按钮(由javascript角度触发)。
现在我写了一个函数,它将整个页面向下滚动,直到没有新的项目:
$("body").on('DOMSubtreeModified', ".asset-view-list", function() {
console.log("DOM changed, scroll again");
$('.info-text')[0].scrollIntoView(true);
var dates = $("thead .broadcast-listing__header td");
$("tbody").each(function( index1 ) { // in each of these <tbody> elements there is an Item I want to download:
var movies = $(this).find(".broadcast-listing__item");
movies.each(function( index ) {
//Here I want to click on the Download Button for each Items and save the movie with the new name:
var movieName = $(dates[index1]).text() + $( this ).find(".broadcast-listing__title").attr("title");
console.log(index,movieName);
})
});
});
我看到https://jsfiddle.net/dipakthoke07/ajbghfhh/73/让您可以下载和监控(是否仍在下载,取消,完成)具有已知URL的文件;但是我怎么能在不知道具体项目的URL的情况下解决我的问题?