小编Ani*_*ket的帖子

如何使用 div 中的 id 和 class 在 selenium python 中查找元素

如何在 div 中同时使用 id 和 class 在 selenium python 中查找元素,然后单击它:

<div id="abc" class="xyz" style="" role="presentation"></div>
Run Code Online (Sandbox Code Playgroud)

我正在使用以下代码:

arrow = driver.find_element_by_xpath('//div[@id="abc"][@class="xyz"]')
arrow.click()
Run Code Online (Sandbox Code Playgroud)

但我收到错误如下:

NoSuchElementException: Message: Unable to locate element: {"method":"xpath","selector":"//div[@id=\"abc\"][@class=\"xyz\"]"}
Run Code Online (Sandbox Code Playgroud)

python selenium xpath

4
推荐指数
1
解决办法
2万
查看次数

TCL 中的错误处理

我有以下程序:

proc show_information {args} {
set mandatory_args {
        -tftp_server
        -device ANY
        -interface ANY

}
set optional_args {
        -vlan ANY

}

parse_dashed_args -args $args -optional_args $optional_args -mandatory_args $mandatory_args

log -info "Logged in device is: $device"
log -info "Executing proc to get all data"
set commands {
              "show mpls ldp neighbor"
              "show mpls discovery vpn"
              "show mpls interface"
              "show mpls ip binding"
              "show running-config"
              "show policy-map interface $intr vlan $vlan input"
              "show run interface $intr
            }

foreach command $commands {
    set show …
Run Code Online (Sandbox Code Playgroud)

error-handling tcl

0
推荐指数
1
解决办法
4922
查看次数

标签 统计

error-handling ×1

python ×1

selenium ×1

tcl ×1

xpath ×1