ICONICO

Discussion Thread

Data Extractor

Message Thread

For WindowsData Extractor

Data Extractor iconExtract any data, including email addresses and URLs from your files and webpages.

Posted in the Data Extractor Forum.




1 result per url

hi, 
say i'm extracting images from a list of URLs...

is it possible to limit the extracted results to one result per URL (even if there are 10 matching results that match my criteria in some of the URLs), i just want it to extract 1 from each.

this is not about duplicates..
there could be 3 images in one URL; i just want it to extract one of them; not list all 3 in results page.

so how do i tell is to skip a url and move on to the next once it got 1 result?

is it possible?


by Roland Fort on Nov 18 2012 9:23am Reply

1 result per url

Data Extractor already has a script called "Extract Image Details from Webpages" please notice this in Tab 2 at the top. To accomplish what you want, I think you need to edit the script by pressing "Edit Rule Detailes" and add a "break;" instruction at the end of the last "for" instruction to ensure that only the first image details are shown for each URL (please see the last part of the script with the "break;" instruction added.

...
...

//loop over array and return results
for (var i=0; i<objColl.length; i++) {
obj = objColl[i];
DataExtractor.StartNewResult();
DataExtractor.AddResult(1, obj.src);
DataExtractor.AddResult(2, obj.width);
DataExtractor.AddResult(3, obj.height);
DataExtractor.AddResult(4, obj.align);
DataExtractor.AddResult(5, obj.fileSize);
DataExtractor.AddResult(6, obj.hspace);
DataExtractor.AddResult(7, obj.vspace);
DataExtractor.AddResult(8, obj.uses);
DataExtractor.AddResult(9, obj.outerHTML);
        break;
}
by Constantin Florea on Nov 18 2012 2:50pm Reply

Our Software Stores

IconicoAccurate Design and Development Software

BitsDuJourDiscount Deal Coupons for Windows and Mac Software Apps

Our Software Services

IcoBlogOur Official Blog

© copyright 2004-2024 Iconico, Inc. Code & Design. All Rights Reserved. Terms & Conditions Privacy Policy Terms of Use Login