You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can I get just "This is some text"? and not "This is some textFirst span textSecond span text"?
<liid="listItem">
This is some text
<spanid="firstSpan">First span text</span><spanid="secondSpan">Second span text</span></li>
Example:
letcheerio=require('cheerio');let$=cheerio.load(`<li id="listItem"> This is some text <span id="firstSpan">First span text</span> <span id="secondSpan">Second span text</span></li>`)letjsonframe=require('jsonframe-cheerio')jsonframe($)letframe={"text": "li#listItem"}console.log($('body').scrape(frame,{string: true}))// {// "text": "This is some text First span text Second span text"// }
The text was updated successfully, but these errors were encountered:
Micka33
changed the title
How to get text without nested span's texts
How to get text without nested children's texts
Mar 9, 2020
How can I get just "This is some text"? and not "This is some textFirst span textSecond span text"?
Example:
The text was updated successfully, but these errors were encountered: