2016-09-08 68 views
0

我该如何编写一个xpath,它会给我以下元素:<span class="ng-binding ng-scope" ng-if="sideData.orderRequestType == 'import'"> ORI - 643 </span>需要在页面上定位元素的帮助

谢谢!

+0

你应该问你的问题太多精确...但是回答这个问题,这是例子的XPath://'跨度[@ class ='ng-binding ng-scope']' – kotoj

+0

这也是正确的xpath:'// span',和this:'// *'。我不知道你的问题是什么:) – kotoj

+0

谢谢!我错过了“跨度”部分! – Tudor

回答

1

您应该考虑元素的哪部分不会改变。 例如,如果class参数始终是一样的,你可以根据class建设的XPath:

//span[@class='ng-binding ng-scope']