问题描述
我的HTML是这样的:
<input type="text" placeholder="Search for extensions" class="user-input" style="width: 370px;">
如果我尝试获取html路径的Xpath,则会在“输入文本”路径以下,但是我也无法输入任何文本并出现以下错误
具有定位符'xpath:// * [@ id =“ extensions-container”] / div / div [3] / div 2 / div 2 / div / div {{3 }} /表单/跨度2 /输入”。
Click Element name:extensions
Input Text xpath://*[@id="extensions-container"]/div/div[3]/div[1]/div[1]/div/div[1]/form/span[1]/input cli
解决方法
尝试使用此定位器:
//input[@placeholder="Search for extensions"]
,
这应该有效:
Input Text css:input[placeholder="Search for extensions"] cli