我试着用普通的.click()
命令点击这个按钮,但它不起作用
手动单击后,类将从这个“glyphsSpriteCircle__outline__24__grey_2 u-__7
”更改为这个“glyphsSpriteCircle_check__filled__24__blue_5 u-__7
”,该怎么办
<button class="dCJp8">
<span aria-label="Toggle selection" class="glyphsSpriteCircle__outline__24__grey_2 u-__7"></span>
</button>
你有一个动态元素
您需要使用不变的零件,如:
也可以对静态零件使用常规表达式,例如
通过xpath(//span[contains(@class,'GlyphsPriteCircle')])查找元素
见mor关于https://www.tutorialspoint.com/how-to-use-regular-expressions-in-xpath-in-selenium-with-python
相关问题 更多 >
编程相关推荐