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
go
microsoftgraph
hyperlink
android-studio-2.2
object
character-encoding
vscode-extensions
visual-studio-emulator
square
ado.net
android-json
nstableheaderview
rcloud
qpython
reactive-programming
siddhi
redis-sentinel
google-form
atlassian
identity-management
undertow
systemtime
dataflow-diagram
epsilon
beta
xcode-ui-testing
delimiter
wcag
python-2.6
gojs
contacts
instantiation
openwhisk
fiware-cygnus
apic
openproject
loading
ogc
dcmtk
portforwarding
android-ibeacon
dynamic-linq
magento-2.0.7
reportservice2010
insight
bluez
flyout
trigger.io
baidu
rxtx
javafx-css
pure-css
webjars
parfor
spring-cloud-feign
http-status-code-401
omniauth-facebook
dbamp
fuzzywuzzy
realsense
mobiledoc-kit
concept-insights
custom-errors
assertion
iokit
rewrite
vigenere
lasso
eoferror
vacuum
baasbox
skspritenode
mraid
kubuntu
cakephp-2.7
primitive-types
structuremap3
webfinger
appserver
universal-image-loader
angular-carousel
lnk
paste
file-not-found
git-repo
ie8-compatibility-mode
away3d
mbunit
jeromq
rolify
cffile
video-codecs
tree-balancing
onmousemove
zope.interface
database-create
koken
wiimote
box2d-iphone
user-tracking
xui
ie-compatibility-mode
blender-2.49
echo3
visualj#
soappy
cardspace

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