<ul data-v-6529428e="" class="el-dropdown-menu el-popper filter-dropdown el-dropdown-menu--medium" id="dropdown-menu-5584" style="transform-origin: center top; z-index: 2014; display: none;"><li data-v-6529428e="" tabindex="-1" class="el-dropdown-menu__item title"><!---->显示的表格列</li><li data-v-6529428e="" tabindex="-1" class="el-dropdown-menu__item"><!----><label data-v-6529428e="" class="el-checkbox is-checked"><span class="el-checkbox__input is-checked"><span class="el-checkbox__inner"></span><input type="checkbox" aria-hidden="false" class="el-checkbox__original" value=""></span><span class="el-checkbox__label">用户名称<!----></span></label></li></ul>
上面的元素对于勾选框无法选中,js修改ul dispaly 属性可见
js = "document.getElementsByClassName('el-dropdown-menu el-popper filter-dropdown el-dropdown-menu--medium')[1].style.display='block';"
driver.execute_script(js)
后面勾选框可直接点击
driver.find_element(*PE.data_report.user_statics_setname).click() //元素已封装 <span class="el-checkbox__input is-checked"><span class="el-checkbox__inner">标签:webdriver,dropdown,menu,元素,selenium,js,选中,el From: https://www.cnblogs.com/other-stone/p/16771274.html