wet-aquaW
Apify & Crawlee4y ago
5 replies
wet-aqua

Scraping for the text in a list item

Currently I try to scrape for the text in a list item (see picture). But with my implementet logic I can only scrape for the <b> tag with the text "Number of Outputs". How can I reach to the following text " : 5"?
Here is my loop for scraping the text of every "li.li-item" :

 $('li.li-item').each((index, element) => {
            const jElement = $(element);
            const ValueName = jElement.find('b').eq(0)?.text()?.trim();
            const Value = jElement.find('#text').eq(0)?.text()?.trim();

            if(ValueName){
                scrapedProducts[ValueName]= Value || '';
            }
            });
Screenshot_2022-12-14_154225.png
Was this page helpful?