File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ const getProductDetails = async(url, merchant) => {
6161 } ) ;
6262 const $ = cheerio . load ( res . data ) ;
6363 const selector = selectors [ merchant ] ;
64- const price = parseInt ( $ ( selector . price1 ) . text ( ) . trim ( ) . replace ( / ^ \D + | [ ^ 0 - 9 . ] / g, '' ) ) || parseInt ( $ ( selector . price2 ) . text ( ) . trim ( ) . replace ( / ^ \D + | [ ^ 0 - 9 . ] / g, '' ) ) ;
64+ const price = parseFloat ( $ ( selector . price1 ) . text ( ) . trim ( ) . replace ( / ^ \D + | [ ^ 0 - 9 . ] / g, '' ) ) || parseFloat ( $ ( selector . price2 ) . text ( ) . trim ( ) . replace ( / ^ \D + | [ ^ 0 - 9 . ] / g, '' ) ) ;
6565 const title = $ ( selector . title ) . text ( ) . trim ( ) ;
6666 const image = $ ( selector . image1 ) . attr ( 'src' ) ;
6767 if ( ! title || ! price ) {
@@ -74,4 +74,4 @@ const getProductDetails = async(url, merchant) => {
7474 }
7575}
7676
77- export { isUrl , getRandomId , getProductDetails , productCommonUrl } ;
77+ export { isUrl , getRandomId , getProductDetails , productCommonUrl } ;
You can’t perform that action at this time.
0 commit comments