什么在 html 标签上归类为 Child?

What classifies as a Child on html tags?

我想解析这个并且需要知道 children 的数量。我被告知评论也应该算作 children。我很困惑将 parent 内的所有标签都算作 children?

<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/Curl 解析事件 class 后,它会将字符串转换为节点 objects。 Objects 被调用到所有断点,即。或者 。 每个节点还可以包含其他 childs 例如

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

在此格式中,class2 是 class event.The 的子 class 或 child 的子event.The 解析 [=19] 的最佳方式=] 是通过 class 名称或 href 查找(搜索)...并且不要使用目标部分的直接路径。它在解析时更加安全和高效。 另一方面,识别 child 的最佳方法只是计算 direct/major 开始和结束部分 < ></>