查找文本的定位器

时间:2014-06-02 11:43:11

标签: html

我为计划角色找到的xpathBy.xpath(".//*[@id='main']/h2),其中包含Project < Visit < Plan Role等其他文字,但我只需要获取计划角色的文字。

 <!DOCTYPE html PUBLIC "abc">
 <html>
 <head>
 <body>
 <div id="errorMsgContainer" class="ui-widget-header"> </div>
 <script type="text/javascript">
 <style>
 <div id="help" class="help">
 <div class="wrapper">
 <div id="header">
 <div id="mainMenu">
 <br clear="all">
 <div class="siteWrapper">
 <div id="content">
  <div id="main" class="main">

   <h2 style="background-color: transparent;">
   <a href="https://abc.com">
   <span style="margin:0px 10px;">›</span>
   <a href="https://abc.com/test2/1.5/">
  <span style="margin:0px 10px;">›</span>
  <a href="https://abc.com/test2/1.5/">
   <span style="margin:0px 10px;">›</span>

      Plan roles

    </h2>
    <ul id="" class="tabPane" style="padding-left:5px;">
    <div class="tabPage">
    </div>
    <div id="footer"></div>
    <div class="clear"></div>
    </div>
    <div class="footer">2006-2013 v1.5.0</div>
    </div>
    <script>
    </div>
    <div id="ui-datepicker-div" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix  ui-corner-all"></div>
   </body>
   </html>

0 个答案:

没有答案