Update scrap_new_items.js
This commit is contained in:
parent
b60b517f8c
commit
deb585e884
|
|
@ -391,7 +391,7 @@ async function main() {
|
||||||
}
|
}
|
||||||
// console.log(`Total configs to process: ${configs.length}`);
|
// console.log(`Total configs to process: ${configs.length}`);
|
||||||
for (const store of configs) {
|
for (const store of configs) {
|
||||||
console.log(`Processing ${store.data}`);
|
// console.log(`Processing ${store.data}`);
|
||||||
// let items = await scrapeWithCheerio(store);
|
// let items = await scrapeWithCheerio(store);
|
||||||
let items = await scrapeWithPuppeteer(store);
|
let items = await scrapeWithPuppeteer(store);
|
||||||
for (const item of items) {
|
for (const item of items) {
|
||||||
|
|
@ -401,6 +401,7 @@ async function main() {
|
||||||
|
|
||||||
// 3️⃣ Insert new record
|
// 3️⃣ Insert new record
|
||||||
const title = (item.title || "").replace("Opens in a new window or tab", "").trim();
|
const title = (item.title || "").replace("Opens in a new window or tab", "").trim();
|
||||||
|
console.log(`Processing ${store.data}`);
|
||||||
console.log({ ...item, title });
|
console.log({ ...item, title });
|
||||||
await axios
|
await axios
|
||||||
.post(
|
.post(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue