cheerio


cheerio reading children of script tag


Hi I have an angular code base. I need to read the code for manipulation
For the below lines in html file when I read the script tag. want to clone & extract the children of the script tag.
No matter what I do . node.children, $(node).html(). the div with id = "not found" cannot be access with node
My JS code is
var $ = cheerio.load(fs.readFileSync(file),{decodeEntities: false});
var scriptTagsInPartial = $('script');
scriptTagsInPartial.each(function(index,node){
console.log(node.children);
});
MYHTML
<script type="text/javascript" id='one.html'>
<script type="text/javascript" id='one.html'>
<div my="data">
<script type="text/javascript" id='one.html'>
<div my="data">HELLOONE</div>
</script>
</div>
</script>
<div id='notfound'></div>
</script>
For node.children
[ { data: '\r\n <script type="text/javascript" id=\'one.html\'>\r\n <div my="data">\r\n <script type="text/javascript" id=\'one.html\'>\r\n <div my="data">HELLOONE</div>\r\n ',
type: 'text',
next: null,
prev: null,
parent:
{ type: 'script',
name: 'script',
attribs: [Object],
children: [Circular],
next: [Object],
prev: [Object],
parent: null,
root: [Object] } } ]

Related Links

confused about cheerio nextUntil
Get the text of the current node only
Accessing the text of a class that contains other elements using Cheerio
cheerio reading children of script tag
how to extract info in this kind of html using cheerio?
Cheerio not finding table content

Categories

HOME
django
httparty
search
google-cloud-platform
facebook-oauth
prism
fuelux
eslint
ng-idle
nvd3.js
fpga
jmx
graphics
access
mips
parameters
pyqt4
hugo
modal-dialog
extjs4.2
categorical-data
mautic
ipmitool
shortest-path
springfox
postscript
direct3d11
gpio
underscore.js
sinch
cppreference
custom-controls
powershell-ise
mustache
jmockit
linkedhashmap
openwhisk
git-rewrite-history
cd
nohup
railstutorial.org
c9.io
apache-stanbol
wmp
facebook-social-plugins
posixct
zenhub
carrot2
azure-cli
javafx-css
builtins
nikeplus-api
installshield-2010
cifilter
php-socket
boost-serialization
highland.js
sapscript
jdk1.7
canvg
nutiteq
telepat
openbabel
at-job
sql-scripts
raygun
build-script
reflector
jquery-slider
fpdi
git-repo
sbcl
scrypt
windows-phone-8-sdk
scringo
facebook-timeline
pagedown
cascadingdropdown
android-sdk-2.3
subgraph
jsr286
virtualpathprovider
cuteeditor
svk
diagrams
globals
pos-for-.net
qtabbar
build-environment
mathematical-notation

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App