I am trying to have the embedded windy app below play automatically when a website is loaded, however, I am not able to get it to work using document.evaluate. Would someone be able to tell me what I am doing wrong in the example below?
var iframe = document.getElementById("frameID");
var elmnt = iframe.contentWindow.document.evaluate(
'//*[@*[starts-with(name(), "data-ref")]="play"]',
document,
null,
XPathResult.ANY_TYPE,
null
).iterateNext().click()
<html>
<body>
<iframe id="frameID" width="650" height="450" src="https://embed.windy.com/embed2.html?lat=28.855&lon=-81.687&detailLat=28.855&detailLon=-81.687&width=650&height=450&zoom=5&level=surface&overlay=radar&product=ecmwf&menu=&message=&marker=&calendar=now&pressure=&type=map&location=coordinates&detail=&metricWind=default&metricTemp=default&radarRange=-1" frameborder="0"></iframe>
</body>
</html>