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
batch-file
oracle12c
turing-machines
checkstyle
google-spreadsheet
angular2-material
static
sitecore
rendering
database-normalization
hpc
banner
joomla3.0
bing-maps
cmdb
endpoint
onedrive-api
event-sourcing
scsi
microsoft-dynamics-nav
asp.net-mvc-viewmodel
soci
sigma.js
nim
delphi-xe5
database-connection
visual-glitch
squashfs
ember-cli
exit
exploit
zxing
resourcebundle
tiki-wiki
angularjs-components
nstimer
genexus-sd
failover
biztalk-rule-engine
fiware-cygnus
git-rewrite-history
bc
google-data-api
typesafe-config
apache-stanbol
vmware-fusion
movilizer
show-hide
tf
x-ray
wpas
skin
javafx-css
rocks
meteor-packages
builtins
greatest-n-per-group
mapinfo
uiactionsheet
kendo-upload
mobiledoc-kit
file-move
opserver
page.js
.bash-profile
visual-sourcesafe-2005
evolus-pencil
typemock
uncompress
branch-and-bound
skspritenode
snoop
typeconverter
apache-spark-1.3
webmatrix-3
primitive-types
browserify-shim
appserver
paw
named-parameters
maven-scm
getopt
accesscontrolexception
android-usb
visual-studio-express
solace-mq
ie8-compatibility-mode
android-icons
pagedown
argouml
patricia-trie
jquery-blockui
dajaxice
luabind
entity-attribute-value
google-floodlight
unattended-processing
msr
build-environment
ifilter
movieplayer
mathematical-typesetting
commercial-application

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