【问题标题】:vba selenium get compound class names not permitted during find element by classvba selenium 获取在按类查找元素期间不允许的复合类名
【发布时间】:2021-04-21 03:11:16
【问题描述】:

我正在使用这种编码

Chromedrive.FindElementByClass("sc-gbzWSY fwFVCo").Click

检查身体是

<button class="sc-gbzWSY fwFVCo">
"Upload Template File"
input type="file" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" 
class="sc-ecaExY kUneBm">
</button>

enter image description here

我出错了

不允许使用复合类名称

请给出解决方案

【问题讨论】:

    标签: excel vba selenium class button


    【解决方案1】:

    不要按 Class 走,因为 Class 似乎是一个动态的。使用下面的 XPath

    //button[contains(.'Upload Template File')]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-03-05
      • 2023-01-03
      • 2023-03-29
      • 2020-11-04
      • 1970-01-01
      • 2022-01-14
      • 2018-05-19
      • 2015-07-12
      相关资源
      最近更新 更多