I'm stuck, in VBA I would like to access HTML elements on a page that uses AngularJS,
All those elements "exist", because I see them when I use the IE debugger tool. They are all in a parent div with class called "cont".
Problem :
when I look the source code of the site, this div is empty. I can see only the structure, which is :
<div
class="cont"
data-ng-controller=".."
..
data-ng-init="initApplication()">
</div>
but nothing inside.. it's loaded probably after by angular.
So when I try to access a button inside this div, example with :
Set IE = CreateObject("InternetExplorer.Application")
IE.document.getElementsById("submitBtn").click
then I get an error saying that the object doesn't exist..
So I tried to add that before :
' wait until IE and the page are ready
Do While .Busy Or Not .readyState = 4: DoEvents: Loop
' wait until the DOM is ready
Do Until .document.readyState = "complete": DoEvents: Loop
but nothing works, I don't understand at all, is it possible to access HTML elements inside this div? why I see evthg in the debugger tool?
Any idea ??
UPDATE
I found that the content of the div is located in a .js file, there are millions of things there but there is :
angular.module("cont").factory("applicationService",["$rootScope","ngDialog","webService",
function(a,b,c){
"use strict";
var d={},
e="home";
d.initApplication=function(){
return c.initContact()
}
and also :
angular.module("cont").run(["$templateCache",function(a){"use strict";
a.put("Application",'ALL THE CONTENT IS HERE (with an HTLM element I would like to click)!!!!!'