This commit is contained in:
Admin 2025-08-14 14:22:25 +07:00
parent 83e08f386c
commit d12c6fbbfc
2 changed files with 12 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -61,6 +61,8 @@ const selectors = {
"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[1]/div/div[4]/div[2]/div/div",
products:
"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[2]/div/div/div[2]/div[1]/div/div[2]/div/div/span/div/div",
products_fallback:
"/html/body/div[1]/div/div[1]/div/div[3]/div/div/div[1]/div[1]/div[2]/div/div/div[2]/div[1]/div/div[2]/div[2]/div",
};
const uploadImages = async (item: IItem) => {
@ -332,7 +334,13 @@ const handle = async (item: IItem) => {
};
const getProducts = async () => {
const products = await thiefService.getElementByXPath(selectors.products);
let products = await thiefService.getElementByXPath(selectors.products);
if (!products) {
products = await thiefService.getElementByXPath(
selectors.products_fallback
);
}
if (!products) return [];
return extractListings(products) as ISyncItem[];