add wait time in job
parent
0d22675923
commit
73669b9c49
12
config.json
12
config.json
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"dev": {
|
"dev": {
|
||||||
|
"temu_orders_shipping_rates" : "D:/Projects/Crawlers/temu-label-crawler/temu_orders_shipping_rates",
|
||||||
"temu_orders_path" : "D:/Projects/Crawlers/temu-label-crawler",
|
"temu_orders_path" : "D:/Projects/Crawlers/temu-label-crawler",
|
||||||
"orders_path": "D:/Projects/Crawlers/amazon_crawler/data/orders",
|
"orders_path": "D:/Projects/Crawlers/amazon_crawler/data/orders",
|
||||||
"voc_path":"D:/Projects/Crawlers/amazon_crawler/data/voc",
|
"voc_path":"D:/Projects/Crawlers/amazon_crawler/data/voc",
|
||||||
|
@ -16,11 +17,13 @@
|
||||||
"shopify_variants_path" : "D:/Projects/Crawlers/amazon_crawler/data/variants",
|
"shopify_variants_path" : "D:/Projects/Crawlers/amazon_crawler/data/variants",
|
||||||
"amz_product_path" : "D:/Projects/Crawlers/amazon_crawler/data/products",
|
"amz_product_path" : "D:/Projects/Crawlers/amazon_crawler/data/products",
|
||||||
"temuLoginPage" : "https://seller.temu.com/login.html",
|
"temuLoginPage" : "https://seller.temu.com/login.html",
|
||||||
"temuOrdersPage" : "https://seller.temu.com/orders.html?activeTab=2",
|
"temuUnshippedOrdersPage" : "https://seller.temu.com/orders.html?activeTab=2",
|
||||||
"temuOrderPage" : "https://seller.temu.com/order-detail.html?parent_order_sn=",
|
"temuOrderPage" : "https://seller.temu.com/order-detail.html?parent_order_sn=",
|
||||||
"temuOrderReportPage" : "https://seller.temu.com/order-reports.html"
|
"temuOrderReportPage" : "https://seller.temu.com/order-reports.html",
|
||||||
|
"temuUnshippedOrdersUrl" : "https://cosmos.utopiadeals.com/cosmos/temu/get-orders-by-status?status=Unshipped"
|
||||||
},
|
},
|
||||||
"prod": {
|
"prod": {
|
||||||
|
"temu_orders_shipping_rates" : "/mnt/AmazonReports/Temu/shipping_rates",
|
||||||
"temu_orders_path" : "/mnt/AmazonReports/Temu",
|
"temu_orders_path" : "/mnt/AmazonReports/Temu",
|
||||||
"orders_path": "/mnt/AmazonReports/amazon-orders",
|
"orders_path": "/mnt/AmazonReports/amazon-orders",
|
||||||
"voc_path": "/mnt/AmazonReports/amazon-voc",
|
"voc_path": "/mnt/AmazonReports/amazon-voc",
|
||||||
|
@ -33,8 +36,9 @@
|
||||||
"cosmos_path_reviews" : "https://portal.utopiaindustries.pk/uind/rest/cosmos/amazon-reviews/edit",
|
"cosmos_path_reviews" : "https://portal.utopiaindustries.pk/uind/rest/cosmos/amazon-reviews/edit",
|
||||||
"cosmos_temu_orders" : "https://cosmos.utopiadeals.com/cosmos/temu/order-upload-json",
|
"cosmos_temu_orders" : "https://cosmos.utopiadeals.com/cosmos/temu/order-upload-json",
|
||||||
"temuLoginPage" : "https://seller.temu.com/login.html",
|
"temuLoginPage" : "https://seller.temu.com/login.html",
|
||||||
"temuOrdersPage" : "https://seller.temu.com/orders.html?activeTab=2",
|
"temuUnshippedOrdersPage" : "https://seller.temu.com/orders.html?activeTab=2",
|
||||||
"temuOrderPage" : "https://seller.temu.com/order-detail.html?parent_order_sn=",
|
"temuOrderPage" : "https://seller.temu.com/order-detail.html?parent_order_sn=",
|
||||||
"temuOrderReportPage" : "https://seller.temu.com/order-reports.html"
|
"temuOrderReportPage" : "https://seller.temu.com/order-reports.html",
|
||||||
|
"temuUnshippedOrdersUrl" : "https://cosmos.utopiadeals.com/cosmos/temu/get-orders-by-status?status=Unshipped"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": "b_uin",
|
"name": "b_uin",
|
||||||
"value": "BTTBCF2WB3OMAZECPIKE6MKAXI4OU7EVQM6PELRHGJR46557J6ODHADFGOEJVAGRXCH65H33ADGRPJKC2PSW5MLX7TTVCUQ",
|
"value": "BTTBDXMWIC246XYTEB2ZLMTZF4ME6WSKD7WZFM244V6GDKDPQMUGXDTUK5I3KZWTZ7LKEMT6DTBRYSWQDV4T65UFVC4LZWA",
|
||||||
"domain": ".seller.temu.com",
|
"domain": ".seller.temu.com",
|
||||||
"path": "/",
|
"path": "/",
|
||||||
"expires": 1736244526.528562,
|
"expires": 1736842796.828001,
|
||||||
"size": 100,
|
"size": 100,
|
||||||
"httpOnly": true,
|
"httpOnly": true,
|
||||||
"secure": true,
|
"secure": true,
|
||||||
|
@ -15,10 +15,10 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "HISTORY_ACCOUNT_TICKET",
|
"name": "HISTORY_ACCOUNT_TICKET",
|
||||||
"value": "MFRDEMLGG5TGKMDFHE4DSNJRMM2WINJUGUZGIYRUMQ3DGNRZGFRDMNBWMYZDIYRSG4ZTQZLCGJRWKNDDGVQTAZLBMNSGCMBVGY4TSY3CG4",
|
"value": "MFRGCYRXMI4TOMTBGY2TQYJVMUZGENRRGBRDCMRSGAZGEZDEHE2DSOBTMY4WMMDFGFSDKOLFGBTDMY3DMNTDGMLGHEYTQNJUGJQTENLCGY",
|
||||||
"domain": ".seller.temu.com",
|
"domain": ".seller.temu.com",
|
||||||
"path": "/",
|
"path": "/",
|
||||||
"expires": 1736244526.52848,
|
"expires": 1736842796.827872,
|
||||||
"size": 128,
|
"size": 128,
|
||||||
"httpOnly": true,
|
"httpOnly": true,
|
||||||
"secure": true,
|
"secure": true,
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
"value": "Ex3V4aoQmdxzIzVHyTsWEYcZvGQSsapj",
|
"value": "Ex3V4aoQmdxzIzVHyTsWEYcZvGQSsapj",
|
||||||
"domain": ".temu.com",
|
"domain": ".temu.com",
|
||||||
"path": "/",
|
"path": "/",
|
||||||
"expires": 1767175726.085074,
|
"expires": 1767774002.932142,
|
||||||
"size": 36,
|
"size": 36,
|
||||||
"httpOnly": false,
|
"httpOnly": false,
|
||||||
"secure": true,
|
"secure": true,
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
"value": "1biXgahvSrTyQ2nJRbyYd",
|
"value": "1biXgahvSrTyQ2nJRbyYd",
|
||||||
"domain": ".temu.com",
|
"domain": ".temu.com",
|
||||||
"path": "/",
|
"path": "/",
|
||||||
"expires": 1767175726.08524,
|
"expires": 1767774002.932846,
|
||||||
"size": 25,
|
"size": 25,
|
||||||
"httpOnly": true,
|
"httpOnly": true,
|
||||||
"secure": true,
|
"secure": true,
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
"value": "100",
|
"value": "100",
|
||||||
"domain": "seller.temu.com",
|
"domain": "seller.temu.com",
|
||||||
"path": "/",
|
"path": "/",
|
||||||
"expires": 1738231726.812448,
|
"expires": 1738829997.102203,
|
||||||
"size": 14,
|
"size": 14,
|
||||||
"httpOnly": false,
|
"httpOnly": false,
|
||||||
"secure": true,
|
"secure": true,
|
||||||
|
@ -83,26 +83,12 @@
|
||||||
"sameParty": false,
|
"sameParty": false,
|
||||||
"sourceScheme": "Secure"
|
"sourceScheme": "Secure"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "hfsc",
|
|
||||||
"value": "L3yJfYky6jb81JDKfQ==",
|
|
||||||
"domain": ".temu.com",
|
|
||||||
"path": "/",
|
|
||||||
"expires": 1767175726.08527,
|
|
||||||
"size": 24,
|
|
||||||
"httpOnly": true,
|
|
||||||
"secure": true,
|
|
||||||
"session": false,
|
|
||||||
"priority": "Medium",
|
|
||||||
"sameParty": false,
|
|
||||||
"sourceScheme": "Secure"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "MALL_ID",
|
"name": "MALL_ID",
|
||||||
"value": "635517729287890",
|
"value": "635517729287890",
|
||||||
"domain": ".seller.temu.com",
|
"domain": ".seller.temu.com",
|
||||||
"path": "/",
|
"path": "/",
|
||||||
"expires": 1735726126.812385,
|
"expires": 1736324397.102015,
|
||||||
"size": 22,
|
"size": 22,
|
||||||
"httpOnly": true,
|
"httpOnly": true,
|
||||||
"secure": true,
|
"secure": true,
|
||||||
|
@ -111,6 +97,34 @@
|
||||||
"sameParty": false,
|
"sameParty": false,
|
||||||
"sourceScheme": "Secure"
|
"sourceScheme": "Secure"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "hfsc",
|
||||||
|
"value": "L3yJfYky6jb81JDKfQ==",
|
||||||
|
"domain": ".temu.com",
|
||||||
|
"path": "/",
|
||||||
|
"expires": 1767774002.932924,
|
||||||
|
"size": 24,
|
||||||
|
"httpOnly": true,
|
||||||
|
"secure": true,
|
||||||
|
"session": false,
|
||||||
|
"priority": "Medium",
|
||||||
|
"sameParty": false,
|
||||||
|
"sourceScheme": "Secure"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "seller_timezone",
|
||||||
|
"value": "Asia%2FKarachi",
|
||||||
|
"domain": "seller.temu.com",
|
||||||
|
"path": "/",
|
||||||
|
"expires": 1767773999.042119,
|
||||||
|
"size": 29,
|
||||||
|
"httpOnly": false,
|
||||||
|
"secure": true,
|
||||||
|
"session": false,
|
||||||
|
"priority": "Medium",
|
||||||
|
"sameParty": false,
|
||||||
|
"sourceScheme": "Secure"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "_nano_fp",
|
"name": "_nano_fp",
|
||||||
"value": "Xpmqnp9xXqCYn5dan9_6~4uR6yKnKyo27XJwbXxn",
|
"value": "Xpmqnp9xXqCYn5dan9_6~4uR6yKnKyo27XJwbXxn",
|
||||||
|
@ -125,20 +139,6 @@
|
||||||
"sameParty": false,
|
"sameParty": false,
|
||||||
"sourceScheme": "Secure"
|
"sourceScheme": "Secure"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "seller_timezone",
|
|
||||||
"value": "Asia%2FKarachi",
|
|
||||||
"domain": "seller.temu.com",
|
|
||||||
"path": "/",
|
|
||||||
"expires": 1767175728.02715,
|
|
||||||
"size": 29,
|
|
||||||
"httpOnly": false,
|
|
||||||
"secure": true,
|
|
||||||
"session": false,
|
|
||||||
"priority": "Medium",
|
|
||||||
"sameParty": false,
|
|
||||||
"sourceScheme": "Secure"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "api_uid",
|
"name": "api_uid",
|
||||||
"value": "Cp13kmdtH2x0PwBBS/KlAg==",
|
"value": "Cp13kmdtH2x0PwBBS/KlAg==",
|
||||||
|
@ -155,10 +155,10 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "OS_SELLER_PASS_ID",
|
"name": "OS_SELLER_PASS_ID",
|
||||||
"value": "TFLY6FCR5HUYYZFXAJW5FNKBQQBT4GVHNRKWDRJ3RYTUVLPR2WSW6BS446BRZZVJCHFRB6O2Q4HAD5QINVWWED5LORYPXEQ5A3NDVZAHX5JA0010648ecf8735",
|
"value": "IG7FX7JXQ523BOJ6MWFVIJUR6EIDFFDEZDE2BKDIZND4QNHJXP25TW3S47QV3ZUMT5233QGXQKAVKCKSOCCQES4CISVBERMQJMWISPZHEJNQ0010648ec1ccd0",
|
||||||
"domain": ".seller.temu.com",
|
"domain": ".seller.temu.com",
|
||||||
"path": "/",
|
"path": "/",
|
||||||
"expires": 1736244526.528544,
|
"expires": 1736842796.827972,
|
||||||
"size": 139,
|
"size": 139,
|
||||||
"httpOnly": true,
|
"httpOnly": true,
|
||||||
"secure": true,
|
"secure": true,
|
||||||
|
@ -186,7 +186,7 @@
|
||||||
"value": "Ex3V4aoQmdxzIzVHyTsWEYcZvGQSsapj",
|
"value": "Ex3V4aoQmdxzIzVHyTsWEYcZvGQSsapj",
|
||||||
"domain": ".temu.com",
|
"domain": ".temu.com",
|
||||||
"path": "/",
|
"path": "/",
|
||||||
"expires": 1767175726.0852,
|
"expires": 1767774002.932683,
|
||||||
"size": 37,
|
"size": 37,
|
||||||
"httpOnly": true,
|
"httpOnly": true,
|
||||||
"secure": true,
|
"secure": true,
|
||||||
|
|
|
@ -12,14 +12,13 @@ const utils = require("./utils");
|
||||||
(async function () {
|
(async function () {
|
||||||
console.log(`===========< STARTED ${luxon.DateTime.now()} >=========`);
|
console.log(`===========< STARTED ${luxon.DateTime.now()} >=========`);
|
||||||
|
|
||||||
|
|
||||||
const syncDate = luxon.DateTime.now().toFormat("yyyy-MM-dd");
|
const syncDate = luxon.DateTime.now().toFormat("yyyy-MM-dd");
|
||||||
|
|
||||||
const screenshotDirectory = path.join(__dirname, `screenshots/${syncDate}`);
|
const screenshotDirectory = path.join(__dirname, `screenshots/${syncDate}`);
|
||||||
|
|
||||||
if ( !fs.existsSync(screenshotDirectory) ) {
|
if (!fs.existsSync(screenshotDirectory)) {
|
||||||
fs.mkdirSync( screenshotDirectory, { recursive: true });
|
fs.mkdirSync(screenshotDirectory, { recursive: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* loading config data
|
* loading config data
|
||||||
|
@ -124,9 +123,10 @@ const utils = require("./utils");
|
||||||
const orderRequestSelector = "div._3yOxLjm0._2pgGmJ7w.IoqjAtdZ.vbGE0cGC";
|
const orderRequestSelector = "div._3yOxLjm0._2pgGmJ7w.IoqjAtdZ.vbGE0cGC";
|
||||||
const element = await page.$(orderRequestSelector);
|
const element = await page.$(orderRequestSelector);
|
||||||
if (element) {
|
if (element) {
|
||||||
|
// wait for 5 sec
|
||||||
|
await new Promise((resolve) => setTimeout(resolve, 5 * 1000));
|
||||||
await element.click();
|
await element.click();
|
||||||
console.log("Clicked on the Request Report btn");
|
console.log("Clicked on the Request Report btn");
|
||||||
|
|
||||||
// take screenshot
|
// take screenshot
|
||||||
let screenshotPath = path.join(
|
let screenshotPath = path.join(
|
||||||
screenshotDirectory,
|
screenshotDirectory,
|
||||||
|
@ -143,6 +143,8 @@ const utils = require("./utils");
|
||||||
`${luxon.DateTime.now().toMillis()}.png`
|
`${luxon.DateTime.now().toMillis()}.png`
|
||||||
);
|
);
|
||||||
await page.screenshot({ path: screenshotPath, fullPage: true });
|
await page.screenshot({ path: screenshotPath, fullPage: true });
|
||||||
|
// wait 10 secs
|
||||||
|
await new Promise((resolve) => setTimeout(resolve, 10 * 1000));
|
||||||
|
|
||||||
const confirmBtnSelector = "div._3yOxLjm0._2pgGmJ7w._1eT_m6dA";
|
const confirmBtnSelector = "div._3yOxLjm0._2pgGmJ7w._1eT_m6dA";
|
||||||
const confirmBtnElement = await page.$(confirmBtnSelector);
|
const confirmBtnElement = await page.$(confirmBtnSelector);
|
||||||
|
@ -150,7 +152,6 @@ const utils = require("./utils");
|
||||||
await new Promise((resolve) => setTimeout(resolve, 15 * 1000));
|
await new Promise((resolve) => setTimeout(resolve, 15 * 1000));
|
||||||
await confirmBtnElement.click();
|
await confirmBtnElement.click();
|
||||||
console.log("Clicked on the Confirm Button");
|
console.log("Clicked on the Confirm Button");
|
||||||
|
|
||||||
// wait for 3 seconds then reload page
|
// wait for 3 seconds then reload page
|
||||||
await new Promise((resolve) => setTimeout(resolve, 3 * 1000));
|
await new Promise((resolve) => setTimeout(resolve, 3 * 1000));
|
||||||
|
|
||||||
|
@ -209,7 +210,6 @@ const utils = require("./utils");
|
||||||
);
|
);
|
||||||
await page.screenshot({ path: screenshotPath, fullPage: true });
|
await page.screenshot({ path: screenshotPath, fullPage: true });
|
||||||
|
|
||||||
|
|
||||||
// wait 60 seconds
|
// wait 60 seconds
|
||||||
await new Promise((resolve) => setTimeout(resolve, 60 * 1000));
|
await new Promise((resolve) => setTimeout(resolve, 60 * 1000));
|
||||||
|
|
||||||
|
|
10
utils.js
10
utils.js
|
@ -285,4 +285,12 @@ exports.getTemuOrderPage = getTemuOrderPage;
|
||||||
const getTemuOrdersPage = function( pageNumber ){
|
const getTemuOrdersPage = function( pageNumber ){
|
||||||
return `https://seller.temu.com/orders.html?activeTab=${pageNumber}`;
|
return `https://seller.temu.com/orders.html?activeTab=${pageNumber}`;
|
||||||
}
|
}
|
||||||
exports.getTemuOrdersPage = getTemuOrdersPage;
|
exports.getTemuOrdersPage = getTemuOrdersPage;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* check list
|
||||||
|
*/
|
||||||
|
const isEmpty = function (arr) {
|
||||||
|
return arr.length === 0;
|
||||||
|
}
|
||||||
|
exports.isEmpty = isEmpty;
|
||||||
|
|
Loading…
Reference in New Issue