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
azure-stream-analytics
c++11
amp-html
camera
pdfbox
babeljs
jetty
google-admin-sdk
p2p
vimdiff
selenium-ide
cumulocity
docx
altera
http-post
dreamweaver
identity-management
bourbon
apache2.4
hta
mongoid6
event-store
slidetoggle
custom-post-type
appirater
bringtofront
cognos-bi
hard-drive
android-maps-extensions
activexobject
latitude-longitude
sim-toolkit
magento-1.9.2.4
amazon-ses
doc
parser-generator
angular-http
clang++
double-click
robomongo
globalize
carrot2
yii2-user
java-6
avx
seq
android-instrumentation
rocks
reporting-services-2012
jodd
refinerycms
aurora
phpwebsocket
redis-cluster
uiactionsheet
blitline
mobiledoc-kit
gocql
pyobjc
entry-point
verold
codeplex
malformedurlexception
vbe
maven-scm
menubar
git-repo
android-audiorecord
eclipse-kepler
embedded-fonts
away3d
oocss
mongohq
node-blade
cardreader
jquery-blockui
adobe-media-server
fitbounds
infobright
procedures
android-holo-everywhere
creole
event-receiver
quotation-marks
eclipse-marketplace
folding
strtod
asynchronous-wcf-call
xslcompiledtransform

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