selenium - How to find element by xpath in shadow dom
问题描述
I have tried the below code for element "Loading History". But not working. Please help to solve by Xpath
seleniumlib = BuiltIn().get_library_instance('SeleniumLibrary')
driver = seleniumlib.driver
root1 = driver.find_element_by_tag_name('sn-component-va-web-client')
shadow_root1 = expand_shadow_element(driver,root1)
shadow_root1.find_element_by_xpath("//div[text()='Loading History']")
解决方案
推荐阅读
- python - 在pytesseract python中保留多个空间
- apache-spark - 加入 SparkSQL 设计一个 JSON
- rx-java - 使用 RxJava 进行定期请求时如何避免重叠请求
- laravel - Carbon - 在数据库中没有记录时检查
- java - 我想知道 list.add() 如何在 Java 运行时在内部工作
- javascript - 为什么我的嵌套子组件不呈现视图?
- python - 仅当“if”语句为真时运行。!
- gradle - 在子项目中修改 gradle 任务
- vb.net - 在 Visual Studio 中突出显示特定行
- jquery - 前三个响应的 jQuery UI 组合框