使用Selenium访问Shadow DOM树 [英] Accessing Shadow DOM tree with Selenium

查看:1013
本文介绍了使用Selenium访问Shadow DOM树的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用Selenium / Chrome webdriver访问Shadow DOM中的元素?

Is it possible to access elements within a Shadow DOM using Selenium/Chrome webdriver?

使用普通元素搜索方法不起作用,这是预期的。我已经在w3c上看到了对 switchToSubTree 规范的引用,但无法提及找到任何实际的文档,示例等。

Using the normal element search methods doesn't work, as is to be expected. I've seen references to the switchToSubTree spec on w3c, but couldn't locate any actual docs, examples, etc.

任何人都成功了吗?

推荐答案

不幸的是,看起来webdriver规范还不支持这个。

Unfortunately it looks like the webdriver spec does not support this yet.

我的窥探未被发现:

http://www.w3.org/TR/webdriver/#switching-to-hosted-shadow-doms

https: //groups.google.com/forum/#!msg/selenium-developers/Dad2KZsXNKo/YXH0e6eSHdAJ

这篇关于使用Selenium访问Shadow DOM树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆