gpt4 book ai didi

java - Jsoup麻烦选择menuitem

转载 作者:行者123 更新时间:2023-11-30 02:39:07 25 4
gpt4 key购买 nike

<span style="display:none"><menu type='ServerMenu' id="EE18_ViewSelectorMenu" CompactMode="true"><ie:menuitem id="EE19_DefaultView" type="option" onMenuClick="window.location = '/Lists/Promo 2015/1A.aspx';" text="1A" menuGroupId="100"></ie:menuitem><ie:menuitem id="EE20_View1" type="option" onMenuClick="window.location = '/Lists/Promo 2015/1ACPGEATS.aspx';" text="1A.CPGE-ATS" menuGroupId="300"></ie:menuitem><ie:menuitem id="EE21_View2" type="option" onMenuClick="window.location = '/Lists/Promo 2015/1ADUTGE.aspx';" text="1A.DUT-GE" menuGroupId="300"></ie:menuitem><ie:menuitem id="EE22_View3" type="option" onMenuClick="window.location = '/Lists/Promo 2015/1ADUTGI.aspx';" text="1A.DUT-GI" menuGroupId="300"></ie:menuitem><ie:menuitem id="EE23_View4" type="option" onMenuClick="window.location = '/Lists/Promo 2015/2A.aspx';" text="2A" menuGroupId="300"></ie:menuitem><ie:menuitem id="EE24_View5" type="option" onMenuClick="window.location = '/Lists/Promo 2015/2AVaASR.aspx';" text="2A.Va.ASR" menuGroupId="300"></ie:menuitem><ie:menuitem id="EE25_View6" type="option" onMenuClick="window.location = '/Lists/Promo 2015/2AVaMSE.aspx';" text="2A.Va.MSE" menuGroupId="300"></ie:menuitem><ie:menuitem id="EE26_View7" type="option" onMenuClick="window.location = '/Lists/Promo 2015/2AVaTSI.aspx';" text="2A.Va.TSI" menuGroupId="300"></ie:menuitem><ie:menuitem id="EE27_View8" type="option" onMenuClick="window.location = '/Lists/Promo 2015/3A.aspx';" text="3A" menuGroupId="300"></ie:menuitem><ie:menuitem id="EE28_View9" type="option" onMenuClick="window.location = '/Lists/Promo 2015/3ADADc_Cloud.aspx';" text="3A.DA.Dc_Cloud" menuGroupId="300"></ie:menuitem><ie:menuitem id="EE29_View10" type="option" onMenuClick="window.location = '/Lists/Promo 2015/3ADAScurit.aspx';" text="3A.DA.S&#233;curit&#233;" menuGroupId="300"></ie:menuitem><ie:menuitem id="EE30_View11" type="option" onMenuClick="window.location = '/Lists/Promo 2015/3ADASI_Cloud.aspx';" text="3A.DA.SI_Cloud" menuGroupId="300"></ie:menuitem><ie:menuitem id="EE31_View12" type="option" onMenuClick="window.location = '/Lists/Promo 2015/3ADASI_Sante.aspx';" text="3A.DA.SI_Sant&#233;" menuGroupId="300"></ie:menuitem><ie:menuitem id="EE32_View13" type="option" onMenuClick="window.location = '/Lists/Promo 2015/3ADATransport.aspx';" text="3A.DA.Transport" menuGroupId="300"></ie:menuitem><ie:menuitem id="EE33_View14" type="option" onMenuClick="window.location = '/Lists/Promo 2015/calendar.aspx';" text="Calendrier" menuGroupId="300"></ie:menuitem><ie:menuitem id="EE34_View15" type="option" onMenuClick="window.location = '/Lists/Promo 2015/MyItems.aspx';" text="&#201;v&#233;nements actuels" menuGroupId="300"></ie:menuitem><ie:menuitem id="EE35_View16" type="option" onMenuClick="window.location = '/Lists/Promo 2015/Export.aspx';" text="Export" menuGroupId="300"></ie:menuitem><ie:menuitem id="EE36_View17" type="option" onMenuClick="window.location = '/Lists/Promo 2015/RssView1.aspx';" text="RssView" menuGroupId="300"></ie:menuitem><ie:menuitem id="EE37_View18" type="option" onMenuClick="window.location = '/Lists/Promo 2015/Salles.aspx';" text="Salles" menuGroupId="300"></ie:menuitem><ie:menuitem id="EE38_View19" type="option" onMenuClick="window.location = '/Lists/Promo 2015/AllItems.aspx';" text="Tous les &#233;v&#233;nements" menuGroupId="300"></ie:menuitem><ie:menuitem id="EE39_View20" type="option" onMenuClick="window.location = '/Lists/Promo 2015/Video.aspx';" text="Video" menuGroupId="300"></ie:menuitem><ie:menuitem id="EE40_CreateView" type="option" iconSrc="/_layouts/images/createview.gif" onMenuClick="window.location = '/_layouts/ViewType.aspx?';" text="Cr&#233;er un affichage" menuGroupId="400"></ie:menuitem></menu></span>

如何获取所有以“onMenuClick="window.location "开头的信息?

我正在使用此代码“Elements links3 = doc.select("menu[id=zz18_ViewSelectorMenu]");”进入菜单,但我无法进入菜单项。

最佳答案

为 android 使用 Jsoup 库 JSOUP

try {
if (SDK_INT >= 10) {
ThreadPolicy tp = ThreadPolicy.LAX;
StrictMode.setThreadPolicy(tp);
}
Document doc = Jsoup
.parse("<span style=\"display:none\"><menu type='ServerMenu' id=\"zz18_ViewSelectorMenu\" CompactMode=\"true\"><ie:menuitem id=\"zz19_DefaultView\" type=\"option\" onMenuClick=\"window.location = '/etudes/Portal/edt/Lists/Promo 2015/1A.aspx';\" text=\"1A\" menuGroupId=\"100\"></ie:menuitem>");
String requiredaspxpage = doc.select("menu#zz18_ViewSelectorMenu")
.get(0).children().get(0).attr("onMenuClick");
} catch (Exception ex) {
ex.printStackTrace();
}

关于java - Jsoup麻烦选择menuitem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26035719/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com