Cheerio: How to select element by text content?
The reason your code isn’t working is because [innerHTML] is an attribute selector, and innerHTML isn’t an attribute on the element (which means that nothing is selected). You could filter the span elements based on their text. In the example below, .trim() is used to trim off any whitespace. If the text equals ‘Category:’, then … Read more