首页 > 解决方案 > 如何引用包含冒号的属性?(硒/python/xpath/css)

问题描述

示例 html

除了wire:模型属性之外,每个字段都具有相同的属性,但我无法链接到它,因为我没有足够的经验来编写正确的选择器。如果您能帮助我做出正确的选择,我将不胜感激。

标签: pythoncssseleniumxpathlaravel-livewire

解决方案


.grid > div:first-child input {
   /* this would target Last Name */
 }

.grid > div:nth-child(3) input {
   /* replace 3 with whatever you want. 1 would target Last Name, 2 would target First Name, 3 would target Middle Name
 }

推荐阅读