具有特定文本的 Jsoup 查找元素
我想使用JSoup从HTML中选择一个具有特定文本的元素。该网页是
<td style="vertical-align:bottom;text-align:center;width:15%">
<div style="background-color:#FFDD93;font-size:10px;margin:5px auto 0px auto;text-align:left;" class="genbg"><span class="corners-top-subtab"><span></span></span>
<div><b>Pantry/Catering</b>
<div>
<div style="color:#00700B;">✓ Pantry Car Avbl
<br />✓ Catering Avbl</div>
</div>
<div>
<div><span>Dinner is served after departure from NZM on 1st day.;</span>...
<br /><a style="font-size:10px;color:Red;" onClick="expandPost($(this).parent());" href="javascript:void(0);">Read more...</a>
</div>
<div style="display:none;">Dinner :2 chapati, rice, dal and chicken curry (NV) and paneer curry in veg &Ice cream.; Breakfast:2 bread slices with jam and butter. ; Omlet of 2 eggs (Non veg),vada and sambar(veg)..; coffee & lime juice</div>
</div>
</div><span class="corners-bottom-subtab"><span></span></span>
</div>
我想找到包含文本“食品储藏室/餐饮”的div元素。我试过了
doc.select("div:contains(Pantry/Catering)").first();
但这似乎不起作用。如何使用 Jsoup 获取此元素?