Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用Selenium(Python)获得显示的对象颜色(没有可用的css颜色)_Python_Selenium - Fatal编程技术网

如何使用Selenium(Python)获得显示的对象颜色(没有可用的css颜色)

如何使用Selenium(Python)获得显示的对象颜色(没有可用的css颜色),python,selenium,Python,Selenium,从一个ASPX页面,我试图得到各种小盒子的颜色。它们表示状态(红色、黄色、绿色),并由脚本更新。与任何其他内容不同,我无法从这些框中获取颜色,因为它们不包含任何颜色信息: <span id="live_states681" style="left: 284px;width: 10px;position: absolute;height: 10px;top: 80px;z-index: 837;"><canvas id="live_states681_canv" width="1

从一个ASPX页面,我试图得到各种小盒子的颜色。它们表示状态(红色、黄色、绿色),并由脚本更新。与任何其他内容不同,我无法从这些框中获取颜色,因为它们不包含任何颜色信息:

<span id="live_states681" style="left: 284px;width: 10px;position: absolute;height: 10px;top: 80px;z-index: 837;"><canvas id="live_states681_canv" width="10" height="10" style="position: absolute;"></canvas></span> 

没有CSS数据我可以使用。 在Chrome中,我可以在颜色信息下找到“颜色:rgb(0,0,0);-内部根颜色html”

知道如何在Python中通过Selenium获得颜色吗