The Cheeriogs library (1ReeQ6WO8kKNxoaA_O0XEQ589cIrRvEBA9qcWpNqdOP17i47u6N9M5Xh0
) for Google App Script is in this GitHub repository:
For this I'm trying to use the following path:
$('td > p br:nth-child(2)');
sheet.getRange(1,1).setValue($(element).nextSibling.text().trim());
From what I understand in other questions answered here in the community, I should use nextSibling
so that when extracting it it looks for the first value after the <br>
tag indicated, but my attempt returned a blank value.
How should I proceed in these cases in order to collect the desired amount?
CodePudding user response:
Will this suffice?
$(str).children()[2].next.data.trim()
First time using cheerio so please correct me if i'm wrong.