I need to find out text " brands related to your search" in below image
How can i write the xpath.The text is present in an iframe which has no id or class or no unique identifier.I was thinking to find it using span data component id but it did not work.
By.xpath("//span[@data-component-id='36']/iframe
Please help
You cannot traverse the elements on an
<iframe>
, it lives in a different context. You need to activate or switch to the context of the iframe, eg. using JavaScript to interact with an iframe and the document inside of it.However, as you can see when you run the snipped, cross-document interactions are only possible if the documents have the same origin. There are other, more involved methods like the postMessage method that provide the means of interacting cross-domain.