Last active
August 15, 2021 21:29
-
-
Save divinity76/3f0278c49f86787041fec137394c9f2d to your computer and use it in GitHub Desktop.
alibaba cheapest quantity checker (price+shipping)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
o={ | |
getTotal:function(){return Number(document.querySelectorAll(".sub-total-area")[0].textContent.match(/[0-9\,\.]+/)[0].split(",").join(""));}, | |
getUnits:function(){return Number(document.querySelectorAll("[data-role='wholesale-order-quantity']")[0].value.toString());}, | |
getPricePerUnit:function(){return (this.getTotal()/this.getUnits());}, | |
}; | |
prices={}; | |
theClearInterval=setInterval(function(){ | |
prices[o.getUnits()]=o.getPricePerUnit(); | |
document.querySelectorAll("a.quantity-up")[0].click(); | |
},2000); | |
clearInterval(theClearInterval); | |
JSON.stringify(prices); | |
<?php | |
$js=; | |
$a=json_decode($js,true); | |
asort($a,SORT_NUMERIC); | |
var_dump($a); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$$("div.list-no-v2-outter").forEach(function(ele) { | |
ele.addEventListener("click", function() { | |
ele.parentNode.removeChild(ele); | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment