Skip to content

Instantly share code, notes, and snippets.

@Vijaysinh
Last active May 11, 2022 11:27
Show Gist options
  • Save Vijaysinh/6cdf0e141b906ad788c603fff875666b to your computer and use it in GitHub Desktop.
Save Vijaysinh/6cdf0e141b906ad788c603fff875666b to your computer and use it in GitHub Desktop.
gemproducts
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