How to get a CSS selector using Selenium WebDriver?

后端 未结 1 1206
猫巷女王i
猫巷女王i 2021-01-27 13:20

I\'m trying to create a dynamic \"element map\" of the elements displayed inside a banner menu including the link displayed for each menu. This map will be stored inside a

相关标签:
1条回答
  • 2021-01-27 14:07

    The answer is No. You cannot extract a CSS selector from a WebElement.

    Why? Because the WebElements themselves are found by the By class.. What if the By specified was xpath? How would it populate the CSS selector?

    0 讨论(0)
提交回复
热议问题