From eb27b75d4d9647a4522cbad44de6f90569425174 Mon Sep 17 00:00:00 2001 From: Edward Peterson Date: Wed, 3 May 2023 17:07:30 -0400 Subject: [PATCH] Added mecum processor --- crawlers/topclassiccarsforsale.crawler.js | 1 + processors/mecum.processor.js | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 processors/mecum.processor.js diff --git a/crawlers/topclassiccarsforsale.crawler.js b/crawlers/topclassiccarsforsale.crawler.js index 7f46bbc..4d91df5 100644 --- a/crawlers/topclassiccarsforsale.crawler.js +++ b/crawlers/topclassiccarsforsale.crawler.js @@ -4,6 +4,7 @@ const superagent = require('superagent'); module.exports = { cronString: '0 22 * * *', run: async function () { + return; const startingPoint = 'https://topclassiccarsforsale.com/amc'; const browser = await puppeteer.launch({ headless: true diff --git a/processors/mecum.processor.js b/processors/mecum.processor.js new file mode 100644 index 0000000..73015c9 --- /dev/null +++ b/processors/mecum.processor.js @@ -0,0 +1,20 @@ +const genericBootstrapFactory = require("./generics/generic-bootstrap"); +const genericVinParserFactory = require("./generics/generic-vin-parser"); + + +module.exports = { + execute: genericBootstrapFactory({ + baseUrl: 'mecum.com', + pageLoadIndicator: 'html body div#__next main#page-content div.Container_containerW__RTJwy.Container_paddingBtm__RIfcP article.innerWrap section.LotHeader_lotHeader__9tt91 div.LotHeader_gallerySection__LZQOt', + vinSelector: 'html body div#__next main#page-content div.Container_containerW__RTJwy.Container_paddingBtm__RIfcP article.innerWrap section.LotHeader_lotHeader__9tt91 div.LotHeader_headerBottom__F8FRR div.LotHeader_meta__3S0lZ div.LotHeader_odometerSerial___fuHb div p', + carouselTrigger: 'html body div#__next main#page-content div.Container_containerW__RTJwy.Container_paddingBtm__RIfcP article.innerWrap section.LotHeader_lotHeader__9tt91 div.LotHeader_gallerySection__LZQOt section.ImageGallery_imageGallery__qITSq.LotHeader_gallery__OrqMX.image-gallery.ImageGallery_standard__a65TU div.ImageGallery_mainImage__GFBTp button.ImageGallery_imageButton__ld6Eg' + }), + baseUrl :'mecum.com', + parseVIN: genericVinParserFactory({ + vinElementSelector: `html body div#__next main#page-content div.Container_containerW__RTJwy.Container_paddingBtm__RIfcP article.innerWrap section.LotHeader_lotHeader__9tt91 div.LotHeader_headerBottom__F8FRR div.LotHeader_meta__3S0lZ div.LotHeader_odometerSerial___fuHb div p` + }), + parseMileage: async function (page) { + return null; + } +} +