I’m trying to get the dollars value that is inside an iframe ($75.12). I can store the iframe doing this:
var frm = document.getElementsByTagName("iframe")[0]
but I cannot proceed doing something like
frm.contentWindow.document.getElementsByTagName("div")
since I get security error about cross origin frame.
Is there a way to store the content of variable frm
in plain text? or what do you suggest?
The iframe looks like this:
<iframe class="transact-client-iframe transact-client-open" name="transact-client" src="https://examplesite.com">
'#document (https://examplesite.com)
<!DOCTYPE html>
<html lang="en-us">
<head></head>
<body class="transact__layout--flex">
<div class="animated idx" style="display: none;"></div>
<div id="ufst" class="vetyu-apptn">
<div class="apptn">
<div class="apptn_header"></div>
<div class="apptn_content">
<div class="py-values">
<div class="py-values_wallet">
<div class="py-values_balance">
<div id="vetyu6" class="help-popout vetyu-view"></div>
<div class="py-value">$75.12</div>
</div>
</div>
<div class="row align-center"></div>
<div class="py-values_ctas"></div>
<div class="py-values_preferences"></div>
</div>
</div>
</div>
</div>
<form style="display: none"/></form>
</body>
</html>
</iframe>