我为计划角色找到的xpath
是By.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>