Last active
May 11, 2022 11:27
-
-
Save Vijaysinh/6cdf0e141b906ad788c603fff875666b to your computer and use it in GitHub Desktop.
gemproducts
This file contains hidden or 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
var title = []; | |
var price = []; | |
for(i=1;i<=10;i++){ | |
console.log(i); | |
$.ajax({ | |
url: "https://mkp.gem.gov.in/home/search?q[]=gym&page="+i+"&_xhr=1", | |
type: 'POST', | |
async: false, | |
success: function(data) { | |
$(data).find('.price .variant-final-price').each(function(node,ttt) { | |
price.push(ttt.textContent); | |
}); | |
$(data).find('.variant-brand').each(function(node,ttt) { | |
title.push({"text":ttt.textContent,"cost":price[node]}); | |
}) | |
} | |
}); | |
} | |
console.table(title); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment