File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed
Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -41,11 +41,9 @@ const getProductDetails = async(url, merchant) => {
4141 let link = new URL ( url ) ;
4242 if ( merchant == 'amazon' ) link . searchParams . set ( 'tag' , 'asloot-21' ) ;
4343 link = link . toString ( ) ;
44- const price = parseInt ( $ ( selector . price1 ) . text ( ) )
45- // .trim().replace(/^\D+|[^0-9.]/g, '')) || parseInt($(selector.price2).text().trim().replace(/^\D+|[^0-9.]/g, ''));
44+ const price = parseInt ( $ ( selector . price1 ) . text ( ) . trim ( ) . replace ( / ^ \D + | [ ^ 0 - 9 . ] / g, '' ) ) || parseInt ( $ ( selector . price2 ) . text ( ) . trim ( ) . replace ( / ^ \D + | [ ^ 0 - 9 . ] / g, '' ) ) ;
4645 const title = $ ( selector . title ) . text ( ) . trim ( ) ;
4746 const image = $ ( selector . image1 ) . attr ( 'src' ) ;
48- console . log ( price , title , image ) ;
4947 if ( ! title || ! price ) {
5048 return { ok : false }
5149 }
You can’t perform that action at this time.
0 commit comments