无法获得有效的选择器来实现 I.click()
Cannot get a valid selector to implement I.click()
当我 F12
时,我试图点击一个包含这些详细信息的按钮
<a data-codecept="searchGo" id="9" class="a-button a-button--white clearfix block showall" suggestrow"="" alt="/s/lundhags/?searchparam=lundhags" onmouseover="suggest.handleMouseOver(9);" onmouseout="suggest.handleMouseOut(9)" onclick="suggest.handleSubmit();" xpath="1">Show all results for 'lundhags'<span class="a-icon a-button__icon a-button__icon--double-arrow"></span></a>
我已经复制了 xpath 并且我有这样的代码=>
I.click('//*[@id="9"]');
我收到了这个错误
Clickable //*[@id="9"] was not found by text|CSS|XPath
我做错了什么?
现在可以使用了!我使用了特定的标识符
I.click('[data-codecept="searchGo"]');
当我 F12
时,我试图点击一个包含这些详细信息的按钮<a data-codecept="searchGo" id="9" class="a-button a-button--white clearfix block showall" suggestrow"="" alt="/s/lundhags/?searchparam=lundhags" onmouseover="suggest.handleMouseOver(9);" onmouseout="suggest.handleMouseOut(9)" onclick="suggest.handleSubmit();" xpath="1">Show all results for 'lundhags'<span class="a-icon a-button__icon a-button__icon--double-arrow"></span></a>
我已经复制了 xpath 并且我有这样的代码=>
I.click('//*[@id="9"]');
我收到了这个错误
Clickable //*[@id="9"] was not found by text|CSS|XPath
我做错了什么?
现在可以使用了!我使用了特定的标识符
I.click('[data-codecept="searchGo"]');