我是Xpaths的新手,或者單獨編碼,所以請和我一起裸照。Xpath class id + text
我想湊在以下網站權限表:https://register.fca.org.uk/ShPo_FirmDetailsPage?id=001b000000MfaDiAAJ
我tryinng找出是否XPath是能夠找到特定類文本以後像這樣的(請注意,ID是隨機的,以便如果你想獲得的類元素無法找到使用它們,而且類是相同的每個表)
提供建議在購房計劃
<div id="a2Nb000000035ohEAA" class="collapse DisciplineDetails PassportDetails PermDesc">
<h3 class="PermissionsListHeader">Advising on a home purchase plan</h3>
<br>
<br>
</div>
<ul class="PermissionConditionsList">
<li class="PermissionsConditionsItem">
Customer Type
<ul class="PermCondsLimitationsList">
<li style="list-style: none"><span id="j_id0:j_id1:j_id110:regActTable:0:j_id531:0:j_id533:0:j_id535:0:j_id538"></span></li>
<li class="PermCondsLimitationsItem Popover">Customer</li>
</ul>
</li>
</ul>
<ul class="PermissionConditionsList">
<li class="PermissionsConditionsItem">
Investment Type
<ul class="PermCondsLimitationsList">
<li style="list-style: none"><span id="j_id0:j_id1:j_id110:regActTable:0:j_id531:1:j_id533:0:j_id535:0:j_id538"></span></li>
<li class="PermCondsLimitationsItem Popover">Home purchase plans</li>
</ul>
</li>
</ul>
</div>
你能解釋更多您的要求?你想獲得匹配文本的類名,或者你想獲得匹配文本的div嗎? – maheeka
嗨Maheeka,並感謝您的幫助。我試圖提取表,以便XPath可以找到類「PermissionsListHeader」與「購房計劃諮詢」文本相匹配的表,並提取客戶類型(在這種情況下爲「客戶」,但可以有幾個這些) – Tomas