【发布时间】:2017-12-26 07:55:43
【问题描述】:
第 1 行确实找到了选择器
Wait Until Element Is visible xpath=//a[contains(text(),'Download selected certificate')]
然后当我尝试获取 href 元素时
${url}= Get Element Attribute xpath=//a[contains(text(),'Download selected certificate')]/@href
失败了 错误说
InvalidSelectorException:消息:无效选择器:由于以下错误,无法使用 xpath 表达式 //a[contains(text(),'Download selected certificate')]/ 定位元素: SyntaxError: 无法对“文档”执行“评估”:字符串 '//a[contains(text(),'Download selected certificate')]/' 不是有效的 XPath 表达式。
我不知道为什么,因为我有一个使用类似语法的不相关示例
${url}= Get Element Attribute xpath=//tr[contains(b/span, Jul)][${row_number}]/td[5]/span/a/@href
【问题讨论】:
标签: xpath robotframework