shadow-dom

How to read text that is under #shadow-root (user-agent)

早过忘川 提交于 2021-02-02 09:52:26
问题 I am using Selenium (Python) for automating a web page. I am trying to get text from an input field that is under #shadow-root (user-agent). Xpath I used: driver.find_element_by_xpath("**//*/p-calendar/span/input**").text is not returning anything. Attached the screenshot of my DOM element. Requirement: To get text from the shadow root : 01:01 回答1: As per @hayatoito 's (creator of Shadow DOM) comment: The original motivation of introducing a closed shadow tree is "Never allow an access to a

Getting “Nosuch element Exception” in Selenium Though XPATH is correct. Not sure is this due to Shadow DOM. Please confirm

人走茶凉 提交于 2021-01-28 06:04:51
问题 I am trying to automate Salesforce application Using Selenium and getting NoSuchelementException though XPATH is correct and valid for particular object. When i have searched the issue, it might be reason for Shadow DOM. For EX: So XAPTH i have written like, driver.findElement(By.xpath("//input[@name='Name']")).sendKeys("Jams"); or driver.findElement(By.xpath("//input[@id='input-299']")).sendKeys("Jams"); This XPATH is highlighting in Console as well. But while automating it throws

Getting “Nosuch element Exception” in Selenium Though XPATH is correct. Not sure is this due to Shadow DOM. Please confirm

时间秒杀一切 提交于 2021-01-28 05:55:00
问题 I am trying to automate Salesforce application Using Selenium and getting NoSuchelementException though XPATH is correct and valid for particular object. When i have searched the issue, it might be reason for Shadow DOM. For EX: So XAPTH i have written like, driver.findElement(By.xpath("//input[@name='Name']")).sendKeys("Jams"); or driver.findElement(By.xpath("//input[@id='input-299']")).sendKeys("Jams"); This XPATH is highlighting in Console as well. But while automating it throws

chrome extension shadow DOM import boostrap fonts

大城市里の小女人 提交于 2021-01-27 19:02:17
问题 so I'd like to display bootstrap 3 icons in a shadowroot added from a chrome extension content script. So far its not working, help? manifest.js does include the woff file in web_accessible_resources shadow root has style tag with: @import url(chrome-extension://__MSG_@@extension_id__/fonts/glyphicons-halflings-regular.woff2); What am I missing? 回答1: To import a font, you should not use @import url which is used to import a CSS stylesheet. Instead, you should use the @font-face directive.

Can I get a button in shadowDOM to submit a form not in shadowDom?

旧街凉风 提交于 2021-01-23 04:59:47
问题 I just ran into an interesting situation where I have a submit <button> inside the shadowDOM of a native custom element that is placed inside a <form> . <form id="one" action="" method="get"> <s-button>Select</s-button> #shadow-root <button>...</button> <button>Outside</button> </form> I also have a <button> as a direct child of the <form> . The child <button> causes the form to submit. But the <button> in the shadow-root does not. In a way I guess this makes sense. But has anyone figured out

Can I get a button in shadowDOM to submit a form not in shadowDom?

為{幸葍}努か 提交于 2021-01-23 04:59:37
问题 I just ran into an interesting situation where I have a submit <button> inside the shadowDOM of a native custom element that is placed inside a <form> . <form id="one" action="" method="get"> <s-button>Select</s-button> #shadow-root <button>...</button> <button>Outside</button> </form> I also have a <button> as a direct child of the <form> . The child <button> causes the form to submit. But the <button> in the shadow-root does not. In a way I guess this makes sense. But has anyone figured out

Can I get a button in shadowDOM to submit a form not in shadowDom?

僤鯓⒐⒋嵵緔 提交于 2021-01-23 04:58:52
问题 I just ran into an interesting situation where I have a submit <button> inside the shadowDOM of a native custom element that is placed inside a <form> . <form id="one" action="" method="get"> <s-button>Select</s-button> #shadow-root <button>...</button> <button>Outside</button> </form> I also have a <button> as a direct child of the <form> . The child <button> causes the form to submit. But the <button> in the shadow-root does not. In a way I guess this makes sense. But has anyone figured out

Can't locate elments within shadow-root (open) using Python Selenium

微笑、不失礼 提交于 2021-01-20 08:34:34
问题 I'm trying to get the content under Signers, Counter Signers and X509 Signers from https://www.virustotal.com/gui/file/03d1316407796b32c03f17f819cca5bede2b0504ecdb7ba3b845c1ed618ae934/details from selenium import webdriver op = webdriver.ChromeOptions() op.add_argument('headless') driver = webdriver.Chrome(executable_path="/Desktop/chromedriver", options=op) details_url = "https://www.virustotal.com/gui/file/03d1316407796b32c03f17f819cca5bede2b0504ecdb7ba3b845c1ed618ae934/details" driver.get

Can't locate elments within shadow-root (open) using Python Selenium

浪子不回头ぞ 提交于 2021-01-20 08:34:21
问题 I'm trying to get the content under Signers, Counter Signers and X509 Signers from https://www.virustotal.com/gui/file/03d1316407796b32c03f17f819cca5bede2b0504ecdb7ba3b845c1ed618ae934/details from selenium import webdriver op = webdriver.ChromeOptions() op.add_argument('headless') driver = webdriver.Chrome(executable_path="/Desktop/chromedriver", options=op) details_url = "https://www.virustotal.com/gui/file/03d1316407796b32c03f17f819cca5bede2b0504ecdb7ba3b845c1ed618ae934/details" driver.get

Shadow-root sibling elements disappear on attachShadow() call

耗尽温柔 提交于 2021-01-05 08:37:11
问题 When I call host.attachShadow({mode: 'open'}) on a div containing a few elements inside, the contents of the div seemingly disappears. The elements are still visible from devtools but are no longer visible on screen. It doesn't matter if i fill the shadowRoot with anything; as soon as the shadow is attached the div's children disappear. Demo on codepen: https://codepen.io/anon/pen/VrBdOe Why does the content disappear? I've seen it on websites so I know it's possible somehow. See the code for