diff --git a/processors/cruisinclassicsinc.processor.js b/processors/cruisinclassicsinc.processor.js new file mode 100644 index 0000000..66a3d56 --- /dev/null +++ b/processors/cruisinclassicsinc.processor.js @@ -0,0 +1,30 @@ +const _ = require('lodash'); +const genericVinParserFactory = require("./generics/generic-vin-parser"); + +module.exports = { + baseUrl: 'cruisinclassicsinc.com', + execute: async function (page) { + const pageLoadIndicator = '.show-car-thumbs'; + await page.waitForSelector(pageLoadIndicator); + const imageSelector = '.show-car-thumbs > a'; + const images = await page.$$(imageSelector); + console.log(`Found ${images.length} images...`) + const sources = await Promise.all(images.map(async carouselItem => { + const src = await page.evaluate(el => el.getAttribute('data-original'), carouselItem); + if(!src) { + return {} + } + // console.log(src); + return { url: src }; + })); + return sources; + + }, + parseVIN: async function (page) { + return null; + }, + parseMileage: async function (page) { + return null; + } + +} \ No newline at end of file