1

I have a given website with lazy loading function, which loads 20 new items when you scroll down the page. Each of them has a download button (triggered by javascript in angular).

Now I wrote a function which scrolls the whole page down till there is no new Item:

$("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);
         })
      });
  });

I saw the Chrome Extension Download API gives you the possibility to download and monitor(is it still downloading, canceled, finished) a file with a known URL; but how could I solve my problem, without knowing the URL to the specific Items?

Suisse
  • 3,467
  • 5
  • 36
  • 59

0 Answers0