<div _ngcontent-tpr-c123="" class="panel panel--bordered">hac-action: 1: /wae:wae/wae-ha:ha-config/ha-data-sync</div>
old_config_xpath = "//div[contains(text(),'hac-action')]"
element_value = wae_base_params[self.driver_key].find_element_by_xpath(old_config_xpath).text
元素值为空
注意:上面的HTML代码不是网页上可见的内容
我没有看到该网站的页面源代码,但请测试以下代码,并让我知道结果。在过去,我使用get_属性('innerHTML')而不是'text',它工作正常。如果你能告诉我结果,我会很高兴的
任何元素的位置都是在DOM上
确保元素位于DOM上的方法是使用带有预期_条件的^{} :
相关问题 更多 >
编程相关推荐