sr0miao
V2EX  ›  问与答

问一个关于 Xpath 的问题,是关于如何过滤标签的,问题详情在正文,请大家指教。

  •  
  •   sr0miao · Oct 16, 2018 · 1288 views
    This topic created in 2795 days ago, the information mentioned may be changed or developed.
    <div class="content">
      <p>
       <a>test</a>
       <a class="1">test</a>
    ....
       </p>
       <p>
       <h2>test</h2>
    ....
       </p>
       <h1>...</h1>
       <div class='div1'>
        </div>
       <div class='div2'>
        </div>
    </div>
    

    我想获取 class="content"为 div 里除了 class="div1"和 class="div2"的所有文本内容,那么如何过滤这两个 div 呢,可以在 xpath 语法里不取这两个 div 么

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   957 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 21:49 · PVG 05:49 · LAX 14:49 · JFK 17:49
    ♥ Do have faith in what you're doing.