简体   繁体   English

获取所选元素内的所有元素作为元素 Jsoup android 的数组

[英]get all elements inside selected Element as an array of Element Jsoup android

How to get the all Elements <li> inside <ul> in jsoup如何在jsoup中获取<ul>中的所有元素<li>

I've select the <ul> using this code我已经使用此代码选择了<ul>

 Elements elements = document.select("ul.small-list.width300");

so how to got it as ArrayList of Elements那么如何将它作为Elements ArrayList

Image may describe more :)图片可以描述更多:)

在此处输入图片说明

According to the specification, select() returns Elements which is a list of Element s .根据规范, select()返回Elements ,它是Element s列表

Add > li to your selector to get all li tags directly inside the ul element:> li添加到您的选择器以直接在ul元素中获取所有li标签:

Elements elements = document.select("ul.small-list.width300 > li");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM