update
This commit is contained in:
parent
83e08f386c
commit
d12c6fbbfc
File diff suppressed because one or more lines are too long
|
|
@ -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",
|
"/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:
|
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",
|
"/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) => {
|
const uploadImages = async (item: IItem) => {
|
||||||
|
|
@ -332,7 +334,13 @@ const handle = async (item: IItem) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const getProducts = async () => {
|
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 [];
|
if (!products) return [];
|
||||||
|
|
||||||
return extractListings(products) as ISyncItem[];
|
return extractListings(products) as ISyncItem[];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue