Reputation: 33
I want to get a result from this website: https://panel.undergroundromania.ro/profile.php?user=2041 I want to get the Nume: X variable and Prenume: Y variable, but they are in the same block and I can't just isolate the variables, how can I get two separate results with cheerio scraping in js? I need something like:
var nume = $('body > div.c-wrapper > div > main > div > div > div > div.col-lg-3 > div > div.card-header.text-center > h4 > b').text();
var prenume= $('body > div.c-wrapper > div > main > div > div > div > div.col-lg-4 > div > div.card-header.text-center > h4 > b').text();
Upvotes: 2
Views: 57
Reputation: 443
This did it for me
var nume = $('#pills-ic > b:nth-child(1)').nextSibling.data.substring(2);
var prenume= $('#pills-ic > b:nth-child(3)').nextSibling.data.substring(2);
Upvotes: 2