I'm using selenium on Java to test HTML page. Here's an example of HTML:
<a>
Return to homepage
<script>
<form>...</form>
</script>
</a>
I need to get text of <a> element to check that it's correct. Chrome, Firefox and IE returns me correct text (Return to homepage) when I call element.getText() for this <a> element, but Safari returns me also the text which is located inside <script> tag (which is not text, but HTML code)
Can anyone tell me how to exclude text from `<script>` tag within the HTML DOM when calling `element.getText()`?This happens only in Safari (latest browser and driver version)