$x 可以获得xpath的dom集合,$$ 可以获得css的dom集合。 length 可以反映出集合里的dom个数。 等于1的话就代表只有一个dom,就说明xpath或css是唯一的。 喜欢的点个赞❤吧!