Link to home
Start Free TrialLog in
Avatar of mdolle
mdolle

asked on

Can I use ActiveXObject("Shell.Application") to get meta tags using DOM

Hello Experts!
I have code that creates a Shell.Application and then goes thru to identify instances of IE, and it is working great( thanks to your answers to my last question )
var objShell = new ActiveXObject("Shell.Application");
   var objShellWindows;      
   objShellWindows = objShell.Windows();
   if (objShellWindows != null) {
      for (var i = 0; i < objShellWindows.Count; i++)      {
       objIE = objShellWindows.Item(i);
        if (objIE)  // if there is an objIE, check if it is MPS page
        {
             if ( objIE.LocationURL == MPS_URL )  {  myIE = objIE.LocationURL;   }    
          var ie = new ActiveXObject( "InternetExplorer.Application" );
         ie.Navigate( objIE.LocationURL ); //LocationURL does not have a value yet
         ie.Visible = 1;
         alert("loading");  //let document load, need something like sleep
           
         doc = ie.document;
                        mtags = doc.getElementsByTagName("META");
.
......

The problem is that I need to check the values of meta tags once the page loads.  I tried to use objIE.document, but get error that document is not supported.   So, I created var ie = new ActiveXObject( "InternetExplorer.Application" ); - which I am not sure is necessary or even does what I need- to check ie.document, however when I navigate to objIE.LocationURL, that is still blank, so I cannot check the meta tags.   How can I check the meta tags, it seems like it would be the easiest part of this whole thing..
thanks!
Myra
ASKER CERTIFIED SOLUTION
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mdolle
mdolle

ASKER

thanks!  this is starting to make sense ;)