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
fpga
swt
obfuscation
google-apps
interpolation
jax-ws
gluon-mobile
performancepoint
windows-ce
supervisor
jmp
bourbon
selinux
sar
flask-sqlalchemy
interpreter
beta
surveymonkey
custom-post-type
shared
amazon-quicksight
utorrent
r-grid
jett
hunspell
imagenet
google-earth-engine
cd
p4merge
claims
twilio-click-to-call
java-bytecode-asm
context-sensitive-grammar
boxing
android-testing
mathcad
baidu
rxtx
rsa-archer-grc
mapxtreme
hadoop-2.7.2
webjars
tinkerpop3
nikeplus-api
rspec2
ng-grid
simevents
jclouds
omniauth-facebook
angular-ui-typeahead
dbamp
uiactionsheet
lz77
terracotta
qt5.2
file-move
batik
google-refine
matlab-deployment
diff3
qtwebengine
grouping-sets
ejb-2.x
ssis-data-flow
administration
genymotion-call
mobility
mintty
grails-domain-class
grails-plugin-rabbitmq
paste
clickbank
drupal-nodes
ice-cube
merb
vfs
database-create
infobright
gobject-introspection
ikimagebrowserview
tmx
socketserver
presentation-layer
ajax-polling
application-verifier
nstokenfield
wcf-instancing
google-wave
flvplayback

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