使用jsoup从android解析网页

时间:2017-04-18 22:34:46

标签: java android jsoup

 <p:dataTable id="vendorList"
                     widgetVar="vendorListWidget"
                     var="vendor"
                     value="#{vendorsMaintBean.vendors}"
                     scrollable="true"
                     liveScroll="true"
                     scrollRows="30"
                     scrollHeight="470"
                     reflow="true"
                     resizableColumns="true"
                     filteredValue="#{vendorsMaintBean.filterVendors}"
                     summary="List of all Vendor">

            <f:facet name="header">
                <i class="fa fa-users" aria-hidden="true"></i>
                <p:outputLabel value=" Vendors"/>
            </f:facet>

            <p:ajax event="filter"
                    listener="#{vendorsMaintBean.onFilter}"
                    update=":searchForm:total_panel"
                    ignoreAutoUpdate="true"
                    global="false"
                    process="@this"/>

            <p:column sortBy="#{vendor.locked}"
                      width="15"
                      filterBy="#{vendor.locked}"
                      filterStyle="display: none"
                      style="text-align: center">
                <f:facet name="header">
                    <p:graphicImage library="images" name="lock_icon.png" alt="Locked" title="Lock Status"/>
                </f:facet>
                <p:outputLabel value="#{vendor.locked}" style="display: none"/>
                <p:selectBooleanCheckbox onchange="return false;"
                                         value="#{vendor.locked}"/>
            </p:column>
        </p:dataTable>

我想使用jsoup

在android中废弃上述内容
<meta property="og:description" content="At a very young age, life begins to change">

查询是什么?

1 个答案:

答案 0 :(得分:0)

在开始之前,您必须查看jsoup cookbook https://jsoup.org/cookbook/

您可以使用以下代码。

String html = "<meta property=\"og:description\" content=\"At a very youngage, life begins to change\">";

Document doc = Jsoup.parse(html);

String des = doc.select("meta").attr("content");
相关问题