Last active
May 9, 2020 11:17
-
-
Save JeroenSteen/7815e1754ed7877eff79565638438422 to your computer and use it in GitHub Desktop.
Get 'handelsnamen' from KVK
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
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