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
algorithm
django
embedded
character-encoding
case
themes
apiblueprint
solaris
alarm
seo
interpolation
jquery-ui
jax-ws
categorical-data
vimdiff
plist
aws-sdk
digital-signature
jmp
bourbon
undertow
object-storage
aggregation
tosca
jquery-callback
android-sharedpreferences
intersystems-cache
rpgle
winexe
tpm
alm
aws-codecommit
event-flow
glib
hreflang
dynamic-jasper
pop3
apiary.io
swagger-php
reactivekit
cd
release
recurrent-neural-network
cin
google-data-api
comparison-operators
postgresql-8.4
softmax
outputcache
memory-mapping
httrack
insight
opengl-4
cup
er-diagram
oozie-coordinator
lsyncd
pytables
microstation
model-associations
scaffolding
expectations
refinerycms
bizagi
project-organization
fuzzywuzzy
kendo-upload
toran-proxy
xvim
binomial-theorem
typemock
sha512
ansi
node-serialport
uvc
cryptographichashfunction
mass-assignment
ejb-2.x
at-job
imagefilter
named-parameters
personalization
matrix-inverse
qscrollarea
sbcl
android-usb
isqlquery
dtmf
intersect
zope.interface
inkcanvas
qglwidget
metaweblog
eclipse-marketplace
application-verifier
blender-2.49
cfwindow
wcf-instancing
sqlobject
entitykey
product-management
information-management

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