문제

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