CA
rival-black
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" :

5 Replies
conscious-sapphire•3y ago
There are 2 ways to do this:
1. Scrape the text of the whole
.li-item
element and then remove the Number of Outputs
text from it
2. Get the non-element nodes with .contents()
rival-blackOP•3y ago
Now I can scrape for the whole text but the Value is always only the text from the last li.item.. How can I add the right value to the right specsname?


rival-blackOP•3y ago
An example link where you scrape for specifications: https://buildings.honeywell.com//us/en/products/by-category/video-systems/software/maxpro-nvr-software
MAXPRO® NVR Software | System Agreements & Upgrades | Security Cont...
Learn all about the Honeywell Security MAXPRO® NVR Software. Click to find product details, documentation, ordering info and more.
conscious-sapphire•3y ago
If you are doing anything in a loop like
$('li.li-item')
all selectors inside the loop must reference the looped element so in your code it must start with jElement
. In this case wholeText = jElement.text();
rival-blackOP•3y ago
Thank you just did not see that. Now it works perfectly!