如何在Python中使用Selenium WebDriver获取元素的CSS值(例如颜色) [英] How to obtain CSS value (eg. color) of element using selenium webdriver in Python
本文介绍了如何在Python中使用Selenium WebDriver获取元素的CSS值(例如颜色)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道在Java中可以使用getCSSvalue,所以Python中有等效的东西吗?谢谢
I know in Java one could use getCSSvalue so is there any equivalent in Python? Thanks
推荐答案
element.value_of_css_property(property_name)
应该是Python的getCSSvalue()
的Selenium Webdriver.
element.value_of_css_property(property_name)
should be the Python's Selenium Webdriver equivalent of getCSSvalue()
.
可以在readthedocs页面上找到文档:链接
Documentation can be found on the readthedocs page: Link
这篇关于如何在Python中使用Selenium WebDriver获取元素的CSS值(例如颜色)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文