3

「現在のページ」としてマークされているもの (例では #notimportant/2) の直後にある html ベローのアンカー タグの href 属性を取得するには、XPath 式を記述する必要があります。

<dd>
    <a href="#notimportant/1" class="current-page">1</a>
    <a href="#notimportant/2">2</a>
    <a href="#notimportant/3">3</a>
    <a href="#notimportant/4">4</a>
    <!-- EDIT: Do not return the next sibling if @href ends with /last -->
    <a href="#notimportant/last">last</a>
</dd>

//a[@class='current-page']/../next-sibling-of-first-node/@href のようなものから始めることを考えましたが、ここで立ち往生しています...

誰でもこれで私を助けることができますか?私はグーグルで検索しましたが、XPath は私のお気に入りのスキルではありません (いや、jQuery は使用できません。これは Web アプリケーションではありません)。

4

1 に答える 1

8
//a[@class='current-page']/following-sibling::a[1]
于 2010-02-04T10:53:40.830 に答える