Reputation: 4882
I'm trying to parse through an awful website and I need some help with using cheerio.
I know that if I for example want to get html of a body of a html I do
$('body','html').html();
How do I descend through multiple elements?
(What if I want to get html > body > font > table > tbody > tr ?)
!! Have to be careful with all these elements being immediate children, I do not want to catch some other nonimmediate children (for example if table > table existed)
Upvotes: 1
Views: 2062
Reputation: 1162
You could just do:
$('html > body > font > table > tbody > tr').html()
You can select just like with jQuery selectors
Upvotes: 0