I am trying to get all visible text from a Tableau view using Selenium. I define all visible text as any text that can be searched using any browser's search functionality (i.e. Ctrl+F).
I have already searched many other answers to related questions but none of them worked for my case. I tried the top answer from here. It doesn't work for me from the very start since my browser.page_source
contains no visible text. Here are the contents of my browser.page_source
:
<!DOCTYPE html><html xmlns:ng="" xmlns:tb=""><head><style type="text/css">@charset "UTF-8";[ng\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=1024, maximum-scale=1.3"><meta name="apple-itunes-app" content="app-id=434633927"><meta name="format-detection" content="telephone=no"><script>var BuildId = '9qu3thidy901n388pewixusor';
var StaticAssetsUrlPrefix = '';</script><link rel="stylesheet" type="text/css" href="vizportal.css?9qu3thidy901n388pewixusor"><script src="/javascripts/api/tableau-2.1.0.min.js?9qu3thidy901n388pewixusor"></script><script src="vizportalMinLibs.js?9qu3thidy901n388pewixusor"></script><script src="vizportal.min.js?9qu3thidy901n388pewixusor"></script></head><body class="tb-body"><div ng-app="VizPortalRun" id="ng-app" tb-window-resize="" class="tb-app ng-scope"><!-- uiView: --><div ui-view="" class="tb-app-inner ng-scope"></div><span class="ng-isolate-scope"><div class="tb-toaster tb-enable-selection" data-reactid=".0"></div></span><script type="text/ng-template" id="inline_stackedElement.html"><div tb-window-resize tb-left="left" tb-top="top" tb-right="right" tb-bottom="bottom" tb-visible="visible" class="tb-absolute"></div></script><!-- ngRepeat: stackedElement in stackedElements --><span props="stackedComponentsProps" class="ng-isolate-scope"><div data-reactid=".1"></div></span></div></body></html>
Also tried the top answer here. Obviously, this didn't work as there's no text inside the body
as you can see in the page source above.
What is the correct way to get the visible text in these circumstances?