I want to embed a table (example: https://football.mitoo.co.uk/LeagueTab.cfm?TblName=Matches&DivisionID=1049&LeagueCode=SSEC2021) from another site (Yes, I am aware of the potential security risks) on my website.
The below code results in Uncaught DOMException: Blocked a frame with origin "https://example.com" from accessing a cross-origin frame.
<div id="LeagueTable"></div>
<iframe id="iframe" src="https://football.mitoo.co.uk/LeagueTab.cfm?TblName=Matches&DivisionID=1049&LeagueCode=SSEC2021" style="display:hidden;"></iframe>
<script type="text/javascript">
var iframe = document.getElementById("iframe");
var div = document.getElementById("LeagueTable");
div.innerHTML = iframe.contentWindow.document.querySelector("body > table.leagueTable").innerHTML;
</script>
I have also tried using fetch(url) with similar results.