为了账号安全,请及时绑定邮箱和手机立即绑定

需要有关动态 CSS 选择器的帮助

需要有关动态 CSS 选择器的帮助

月关宝盒 2021-06-29 09:07:49
需要有关动态 CSS 选择器的帮助。我有我想要的 web 元素的以下 CSS 选择器:#sub-cat-822 > div:nth-child(1) > div:nth-child(1) > form:nth-child(1) > div:nth-child(3) > div:nth-child(1) > div:nth-child(2) > input:nth-child(2)我需要传递包含仅用于cat-822 的动态值的变量(变量名称是:Added_Main_category_id1)(在上面的 CSS 选择器中)。请有人建议如何调整上述 CSS 选择器中的变量以使其顺利运行?所需网页元素的外部 html:<input required="required" id="edited_name" name="sub_cate" value="" placeholder="" class="form-control" type="text">所需网页元素的 csspath:html body.nav-md.pace-done.modal-open div.container.body div.main_container div.right_col div.right_col_container div.right_col_wrapper div.x_panel div.x_content div.post-box ul.cat_accordion.list-group li#854.list-group-item.category-list-item-854 div.cat-name div#sub-cat-854.modal.fade.in div.modal-dialog div.modal-content form div.modal-body.clearfix div.edit-photo-poup div.col-xs-8.col-sm-6 input#edited_name.form-control所需网页元素的 cssselector:  #sub-cat-822 > div:nth-child(1) > div:nth-child(1) > form:nth-child(1) > div:nth-child(3) > div:nth-child(1) > div:nth-child(2) > input:nth-child(2)所需网页元素的 xpath://*[@id="edited_name"]
查看完整描述

3 回答

?
隔江千里

TA贡献1906条经验 获得超10个赞

如果 id "edited_name" 在 HTML 源代码中是唯一的,则#edited_name用作 CSS 选择器


查看完整回答
反对 回复 2021-07-07
  • 3 回答
  • 0 关注
  • 128 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信