【发布时间】:2022-08-19 07:17:55
【问题描述】:
我在网页上有一个按钮控件
<button class=\"btn btn-mini download-attachment pull-right width100px margin-bottom-1px\" type=\"button\" data-id=\"48156\"><i class=\"icon-download\"></i> Download</button>
我想获取与之关联的数据ID。我正在使用硒。请建议我如何获取此按钮控件的数据 ID。
-
您可以通过类名获取元素,然后获取属性
data-id
标签: html selenium selenium-webdriver xpath webdriverwait