Skip to content

Instantly share code, notes, and snippets.

@JeroenSteen
Last active May 9, 2020 11:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeroenSteen/7815e1754ed7877eff79565638438422 to your computer and use it in GitHub Desktop.
Save JeroenSteen/7815e1754ed7877eff79565638438422 to your computer and use it in GitHub Desktop.
Get 'handelsnamen' from KVK
all_handelsnamen = '';
function get_handelsnamen() {
handelsnamen = '';
$('h3.handelsnaamHeader > a').each(function(pl) {
handelsnamen += $( this ).html()+"\n";
});
//handelsnamen += "\n";
return handelsnamen;
}
pagination_links = $('ul > li.nav-new__item > button');
for (var i = 0; i < pagination_links.length; i++) {
// create a closure to preserve the value of "i"
(function(i){
window.setTimeout(function(){
console.log(i)
$('ul > li.nav-new__item > button')[i].click();
all_handelsnamen += get_handelsnamen()
if(i == pagination_links.length-1){
console.log(all_handelsnamen)
}
}, i * 2000);
}(i));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment