在html标签上将什么分类为Child


What classifies as a Child on html tags?

我想解析它,并且需要知道子代的数量。有人告诉我,评论也应该算作儿童。我很困惑,把父母体内的所有标签都算作孩子?

<div class="event">
                <h4>Northland Outdoors Duluth Deer Classic</h4>
                <span class="timestamp" style="display: none;">1424282400</span>        
                <p class="date"><span class="month">February</span> 18, <span class="year">2015</span>  </p>    <table><tr><td class="field-name">Location:</td>
                <td class="location">
                    <span class="city">Duluth</span>, 
                    <span class="state">MN</span>, Duluth Entertainment Convention Center</td><td><tr><td class="field-name">Description:</td><td>Join us at the Northland Outdoors Duluth Deer Classic February 18th - 20th, 2015, which will again be held in conjunction...
                <a href="/events/details/northland-outdoors-duluth-deer-classic2" title="View listing detail">View more detail &raquo;</a></td></tr><tr><td class="field-name">Types of Vendor:</td><td>
                <ul class="vendors"><li class="allowed art">Art</li><li class="allowed craft">Craft</li><li class="allowed commercial">Commercial</li></ul>         </td></tr></table><div class="clear"></div></div>

一旦您通过DOM/Coll解析事件类,它就会将String转换为nodes对象。对象被调用到所有断点,即或。每个节点还可以包含其他子节点,如

<div class= 'event'> <p class='class2'>something here</p></div>

在这种格式中,class2是类事件的子类或子类。解析html的最佳方法是按类名或href来查找(搜索)。。。并且不要使用到目标部分的直接路径。它在解析方面更安全、更高效。另一方面,识别子项的最佳方法只是计算直接/主要打开和关闭部分< ></>