擅长:python、mysql、java
<p>完整路径不是最好的路径,也更难阅读。XPath是“过滤器”,请尝试查找所需控件的一些唯一属性,或父控件的一些唯一描述。看,所需的跨度有“value”类,它位于带有“tooltipWrapper”类的跨度内,父跨度还有另一个子跨度,带有“key”类和“openinterest”文本。有数千个定位器,我可以找到两个:</p>
<pre><code>//span[@class = 'tooltipWrapper' and span[string() = 'Open Interest']]//span[@class = 'value']
//span[@class = 'key' and text() = 'Open Interest']/..//span[@class = 'value']
</code></pre>