Esselunga / Scraper.txt
Volzy's picture
Add files using upload-large-folder tool
3fd3488 verified
fs = require("fs")
ids = [300000001021465, 300000001002314, 300000001002027, 300000001002007,
300000001002343, 300000001006876, 300000001002050, 300000001002033]
sets = [
'["4551304", "4551305", "4551307", "4551308", "4551309", "4551310", "4551311", "4551314", "4551326", "4551334"]',
'["24120", "24121", "24123", "24129", "24130", "24131", "24137", "24138", "24143", "24148", "24150", "24153", "24154", "24156", "24157", "24158", "24162", "24262", "24362", "24363", "24364", "24365", "31049", "4546738", "4565944", "4566054"]',
'["24117", "24293", "31470", "4558708", "4558709", "4566096", "4566097", "4566098", "4566099"]',
'[24083, 24085, 4566249, 4545654, 4555725, 33513, 24084, 4566241, 4566238, 24091, 4566244, 4566243, 4566242, 4566236, 4566237, 4566245, 24093, 24094, 24092, 4541712]',
'["24185", "24188", "24289", "24291", "24294", "24295", "24296", "24297", "24298", "24299", "24300", "24301", "24302", "24303", "24304", "24305", "24322", "33324", "33325", "33332", "34197", "34198", "34199", "34200", "34201", "34202", "34203", "34204", "34205", "34206", "36837", "36839", "36841", "38154", "38173", "43898", "4542024", "4542025", "4542708", "4542745", "4566069", "4566101", "4566102", "4566118", "4566119", "4566120", "4566121", "4566122", "4566123"]',
'["4562374", "4566227", "4566228", "4566229", "4566230", "4566231", "4566250", "4566251", "4566253", "4566254"]',
'["24306", "24307", "24309", "24475", "24476", "24478", "39713", "39714", "39733", "4566055", "4566056", "4566057", "4566059"]',
'["33317", "33320", "33321", "33322", "33323", "33330", "33331", "4566100", "24163", "24164", "24165", "24166", "24418" ]'
]
i = 0
code = setInterval( () =>
fetch("https://spesaonline.esselunga.it/commerce/resources/auth/displayable/productset", {
"headers": {
"accept": "application/json, text/plain, */*",
"accept-language": "it-IT,it;q=0.9,zh-CN;q=0.8,zh;q=0.7,en-US;q=0.6,en;q=0.5",
"content-type": "application/json;charset=UTF-8",
"sec-ch-ua": "\"Not A(Brand\";v=\"99\", \"Google Chrome\";v=\"121\", \"Chromium\";v=\"121\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"Windows\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"x-release-ecommerce": "5",
"x-xsrf-token": "20304C9612DD85035D56A111A5167D183290CF74109702FBFA80C50CAF130D51",
"cookie": "trusted_token=0107445de1925a2431d46731a2cdb01be29e085a321fa6d4727e7804008cb236; JSESSIONID=80-9-X1ZfxEW05leqj1Avgn5_XrfEn7YqWhiPGVeka7XCjpZjttl!1113695385; addressVerified=0; cc-performance=yes; cc-targeting=yes; cc_performance=yes; cc_targeting=yes; cc_survey=yes; rmbme-ecom35-x=Dq2YkWomRSbB:4949F6514EB711371615FA8FC910C758EB57AA66E24F6126165D44D1AC4A7E0A12; XSRF-ECOM-TOKEN=20304C9612DD85035D56A111A5167D183290CF74109702FBFA80C50CAF130D51; BIGipServerPOOL-produzione20.esselungaacasa.it-HTTP=!0jP6RQ0qHUHaHTZPdZqHGk3GUL0DYIMkK7fNmgtNlB6abL6PiUdQfz+BFYwHP+0n0z0Fdr8IHkAUYjY=; BIGipServerPOOL-ecom30.webapp.esselungaacasa.it-AEM-HTTP=!Xl1leMAFG3heC4hPdZqHGk3GUL0DYGUJKCbOANFLRnI+FatrHxkze4Z0V9JpluxJT9u95L9mJ4Lvrtk=; BIGipServerPOOL-prod-ecom35-wls-8001=!pg+WoGXihH6VWC5PdZqHGk3GUL0DYEtzK70RlQlE+DAAUbiFGZAVTs/CEbvGnyWwEDmwqJOQXyl6tw==",
"Referer": "https://spesaonline.esselunga.it/commerce/nav/auth/supermercato/store.html?esseiaOtp=999573ea802d5ed9c589532d3fd6aefa02f321ca",
"Referrer-Policy": "strict-origin-when-cross-origin"
},
"body": "{\"productSetIds\":"+ sets[7] + ",\"start\":"+ (i * 15) +",\"length\":15,\"sort\":null,\"filters\":[],\"menuItemId\":"+ ids[7]+ "}",
"method": "POST"
}).then(r => r.json()).then(data => {
i++
if(data["entities"] == null) {
clearInterval(code)
return
}
console.log(i*15);
fs.appendFile("Gastronomia e Piatti Pronti.json", JSON.stringify(data) + "\n", err => {})
}), 200)