Вопрос

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)

Это было полезно?

Решение

You could just do:

$('html > body > font > table > tbody > tr').html()

You can select just like with jQuery selectors

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top