cheerio


Cheerio not finding table content


I need to parse an HTML containg a table.
<div>
<table id="tableID">
<tr>
<td class="tdClass">
<span id="id1">Some data i need to access</span>
</td>
<td class="tdClass">
<span id="id2">Some data i need to access</span>
</td>
</tr>
</table>
</div>
I'm using cheerio on a NW.js app. I can't figure out how to access the datas, I've tried with span's ids, but it doesn't work.
The div is contained in the body of the page.
var $ = cheerio.load(html)
alert($('#id1').html())
I'm getting null when I'm trying to alert the content of the span.
Try this:
$ = cheerio.load(html, {normalizeWhitespace: false, xmlMode: true});

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
shell
azure-stream-analytics
wakanda
amp-html
zend-framework
oracle-apex-5
rendering
alarm
database-normalization
okhttp
openpyxl
java.util.logging
emoji
automatic-ref-counting
shared-libraries
modbus-tcp
job-scheduling
vuejs
bourbon
gmm
replication
windows-xp
symbols
ag
visual-glitch
postscript
resourcebundle
stackexchange
jackson-modules
corpus
fragment-backstack
postback
cart
memory-address
laravel-eloquent
sharding
jwplayer6
yowsup
alphabetical
graphhopper
loading
watchface
datacachefactory
congestion-control
show-hide
apache-directory
getchar
lampp
builder
term
lightning
android-testing
pytables
webjars
seek
iotivity
flex4.6
scaffolding
dup
jclouds
embedding
http-status-code-401
aurora
redis-cluster
np-spring
assertion
xenomai
intel-c++
primitive-types
teaspoon
strawberry-perl
encryption-asymmetric
radiant
syndicationfeed
gtm-oauth2
jeromq
oocss
unit-of-work
flex++
octal
android-sdk-2.3
argouml
frameworkelementfactory
mkv
fusefabric
window-decoration
entitydatasource
jqote
tabpanel
qtabbar
cfwindow
build-environment
cldc
entitykey
technical-debt
ifilter

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