I am trying to extract some data from a webpage where I don't want to use Selenium. So I am using JavaScript in the chrome console, but I am facing the below problem while accessing the iframe.
blocked a frame with origin "example.com" from accessing a cross-origin frame.
I understand the cross-origin issue and have tried multiple things mentioned in other answers but nothing seem to work. The only solution I could think of is programmatically selecting the Frame context otherwise which could be done manually as shown below in the image
Could someone help if there is a way to change this programmatically!
These are somethings I tried
document.querySelector("iframe").contentWindow.document.querySelector(".class name")
var frame = document.querySelector("iframe").contentWindow; cd(frame)