如何使用Python web dri查找“fill=rgb(145158145)”样式

2024-10-03 23:27:07 发布

您现在位置:Python中文网/ 问答频道 /正文

一,;我试图用python web驱动程序捕获元素 在我的代码中有两次尝试

CatchText2 = self.SELENIUM_DRIVER.find_element_by_xpath(self.PictureIcon).get_attribute("style")

CatchText2 = self.SELENIUM_DRIVER.find_element_by_xpath(self.PictureIcon).value_of_css_property('fill')

PicturIcon是元素的xpath

这是我的elemet:

<polygon class="st0" ng-show="dc.getData('vm'+dc.getModel()).reception >=0" ng-style="dc.getData('vm'+dc.getModel()).receptionColor" points="83.7,180.1 34.5,216.5 34.5,244.5 83.7,244.5  " style="fill: rgb(145, 158, 145);"></polygon>

任何帮助都将受到感谢 谢谢


Tags: self元素bystyledriverseleniumelementfind