Bulk ImportXml tool & source (Google docs spreadsheets) | David Sottimano

PHOTO EMBED

Sun May 02 2021 16:36:00 GMT+0000 (UTC)

Saved by @admariner

function bulkXml() {

  var sheet = SpreadsheetApp.getActiveSheet();
  var lastRow = sheet.getLastRow()
  var Num = sheet.getRange(2,1,lastRow,1).getValues();
  
  Num = Num.filter(function(u) { 
   return u[0].length > 2
  })

  for (var y=0;y<2;y++) {
    for (var x=2;x-2 < Num.length;x++)  {
      var url = sheet.getRange(x,1).getValue();
      sheet.getRange(2,6).setValue(url);
      var xpathResult = sheet.getRange(3,6).getValue();    
      var counter = x - 1;
      sheet.getRange("C4").setValue(" PLEASE WAIT...CURRENTLY FETCHING " + counter + " OUT OF " + Num.length);
      
      if (y===1){
        sheet.getRange(x,2).setValue(xpathResult);
        sheet.getRange("C4").setValue("PROCESSED " + counter + " OUT OF " + Num.length);
        SpreadsheetApp.flush();
      }   
    }    
  } 
}

content_copyCOPY

https://davidsottimano.com/bulk-importxml-tool-source/