I have added the screenshot我有一组元素,除了span标签外,它们具有完全相同的xpath。我想识别单个输入字段,但无法识别。
我尝试将contains和class一起使用,但是无法将span附加到xpath
这是HTML的外观:
/ html / body / div [@ id ='app'] / div / div [@ class ='LayoutModify_LayoutModify_1Akxb'] / main [@ class ='LayoutModify_main_5aBy3'] / section [@ class ='sub-detail内部ProductDetail_productdetail_bJWN2'] / div [@ class ='ProductDetail_productsphere_kgNGm'] / div [@ class ='ProductDetail_threecol_2zA1n ProductDetail_productsphereleft_2pLZT '] / span [4] / div [@ class =' el-input el-input--中等ProductDetail_productsphereinput_3eVZg'] / input [@ class ='el-input__inner']
/ html / body / div [@ id ='app'] / div / div [@ class ='LayoutModify_LayoutModify_1Akxb'] / main [@ class ='LayoutModify_main_5aBy3'] / section [@ class ='sub-detail内部ProductDetail_productdetail_bJWN2'] / div [@ class ='ProductDetail_productsphere_kgNGm'] / div [@ class ='ProductDetail_threecol_2zA1n ProductDetail_productsphereright_3BrqC '] / span [4] / div [@ class =' el-input el-input--中等ProductDetail_productsphereinput_3eVZg'] / input [@ class ='el-input__inner']
请注意,span [4]和span [15]是唯一的区别
答案 0 :(得分:0)
快速提问: 执行以下任一定位器:
定位器A
//span[4]/div/input[@class='el-input__inner']
定位符B
//span[15]/div/input[@class='el-input__inner']
在您的页面上找到任何输入吗?
如果没有-您能在这里发布整个HTML页面代码吗?
答案 1 :(得分:0)
这是起作用的xpath: // div [包含(@ class,'ProductDetail_productsphereright')] / span [4] / div / input