none
Navigate through a web page using vbs RRS feed

  • Question

  • I want to navigate through a web page. There are images and words with links on the page.

    the source code is as follows:

    <div id="tabscontroldiv" class="tabMenuButtonNormal" style=" cursor:pointer;" onmouseover="this.className='tabMenuButtonOver'" onmouseout="this.className='tabMenuButtonNormal'"><div tabindex="0" accessKey="1" onkeypress="return CCPopupMenu.dropDown(event,0,0,'TabsMenu');" onclick="return CCPopupMenu.dropDown(event,0,0,'TabsMenu');"><span style="cursor:pointer; "><img style="vertical-align: absmiddle; " name="pageMenu_imgFlyControl" src="/p2pd/skins/corporate/portal/images/page_menu.gif" alt="Tab Menu" title="Tab Menu"></span></div></div></td><td valign="bottom" width="100%" style="padding-"><div class="tabBarContainer"><table cellspacing="0" cellpadding="0" width="100%"><tr><td valign="bottom" style="width:100%;"><div id="tabWindow" onresize="tabEvalScroll();" style="width:100%;><table cellpadding="0" cellspacing="0" border="0" width="100%" id="tabs"><tr><td><div class="tabLeftSelected"></div></td><td nowrap class="tabSelected"><div id="selectedTab" style="">Public Folders</div></td><td><div class="tabRightSelected"></div></td><td valign="bottom"><div class="tabSpacer"></div></td><td><div class="tabLeftNormal"></div></td><td nowrap class="tabNormal"><a class="tabAnchor" onmouseover="window.status='';return true;" onmouseout="window.status='';return true;" href="/p2pd/servlet/dispatch?b_action=xts.run&m=portal/cc.xts&m_tab=iE5E52C5C54EC49CCA0E85D6FBE32E428&m_folder=iE5E52C5C54EC49CCA0E85D6FBE32E428&m_folder2=p-i7B94D6DCADA444CA9215FF52C9889832">My Folders</a></td><td><div class="tabRightNormal"></div></td><td class="tabTail">&nbsp;</td></tr></table></div></td><script language="JavaScript">
    <input class="SYN_LNN" type="label" value="215" /><input class="SYN_BCH" id="syn_ctrl215" role="button" type="label" value="-" />
    var g_sImageRoot = "/p2pd/skins/corporate/shared/images/";
    <input class="SYN_LNN" type="label" value="216" /><input class="SYN_BCH" id="syn_ctrl216" role="button" type="label" value="-" />

    </script><script language="javascript" src="/p2pd/ps/portal/js/tabs.js"></script><td><div id="tabControlLeftContainer" tabindex="0" accesskey="1" class="tabScrollButton" onkeypress="if(event.keyCode==9)return true;tabControlDBLClick('left', event); return true;" onmouseover="tabControlMouseOver(this)" onmouseout="tabControlMouseOut(this)" ondblclick="tabControlDBLClick('left', event); return true;" onmousedown="tabControlPress('left', event); return true;" onmouseup="tabControlRelease(); return true;" title="Scroll left"><img id="tabControlLeft" src="/p2pd/skins/corporate/shared/images/action_scroll_left.gif" title="Scroll left" alt="Scroll left"></div></td><td><div id="tabControlRightContainer" tabindex="0" accesskey="1" class="tabScrollButton" onkeypress="if(event.keyCode==9)return true;tabControlDBLClick('right', event); return true;" onmouseover="tabControlMouseOver(this)" onmouseout="tabControlMouseOut(this)" ondblclick="tabControlDBLClick('right', event); return true;" onmousedown="tabControlPress('right', event); return true;" onmouseup="tabControlRelease(); return true;" title="Scroll right"><img id="tabControlRight" src="/p2pd/skins/corporate/shared/images/action_scroll_right.gif" title="Scroll right" alt="Scroll right"></div></td></tr></table></div></td></tr></table><table width="100%" border="0" cellpadding="0" cellspacing="3"><tr><td valign="middle" width="100%" class="dialogHeaderText"><span class="pathLeafNode">Public Folders</span></td><td width="100%"><img

    My code to go to "My Folders" is as follows:

    Dim colLinks
    Set colLinks = oIE.Document.getElementsByTagName("a")
    For Each objLink In colLinks
    If (objLink = "My Folders")
    Then
    objIE.Navigate objLink.href
    Exit For
    End If
    Next

    'the code does not  work

    Any help is appreciated.

    Regards,

    Manas

    Friday, August 1, 2014 3:55 PM

Answers

  • Try to look into the MSXML Object, as Cognos files are basically XML files.

    See also this link about MSXML of MSDN:

    MSXML Object

    Hope this helps,


    Daniel van den Berg | Washington, USA | "Anticipate the difficult by managing the easy"

    Please vote an answer helpful if they helped. Please mark an answer(s) as an answer when your question is being answered.

    Tuesday, September 16, 2014 5:24 AM
    Moderator

All replies

  • I want to navigate through a web page. There are images and words with links on the page.

    the source code is as follows:

    <div id="tabscontroldiv" class="tabMenuButtonNormal" style=" cursor:pointer;" onmouseover="this.className='tabMenuButtonOver'" onmouseout="this.className='tabMenuButtonNormal'"><div tabindex="0" accessKey="1" onkeypress="return CCPopupMenu.dropDown(event,0,0,'TabsMenu');" onclick="return CCPopupMenu.dropDown(event,0,0,'TabsMenu');"><span style="cursor:pointer; "><img style="vertical-align: absmiddle; " name="pageMenu_imgFlyControl" src="/p2pd/skins/corporate/portal/images/page_menu.gif" alt="Tab Menu" title="Tab Menu"></span></div></div></td><td valign="bottom" width="100%" style="padding-"><div class="tabBarContainer"><table cellspacing="0" cellpadding="0" width="100%"><tr><td valign="bottom" style="width:100%;"><div id="tabWindow" onresize="tabEvalScroll();" style="width:100%;><table cellpadding="0" cellspacing="0" border="0" width="100%" id="tabs"><tr><td><div class="tabLeftSelected"></div></td><td nowrap class="tabSelected"><div id="selectedTab" style="">Public Folders</div></td><td><div class="tabRightSelected"></div></td><td valign="bottom"><div class="tabSpacer"></div></td><td><div class="tabLeftNormal"></div></td><td nowrap class="tabNormal"><a class="tabAnchor" onmouseover="window.status='';return true;" onmouseout="window.status='';return true;" href="/p2pd/servlet/dispatch?b_action=xts.run&m=portal/cc.xts&m_tab=iE5E52C5C54EC49CCA0E85D6FBE32E428&m_folder=iE5E52C5C54EC49CCA0E85D6FBE32E428&m_folder2=p-i7B94D6DCADA444CA9215FF52C9889832">My Folders</a></td><td><div class="tabRightNormal"></div></td><td class="tabTail">&nbsp;</td></tr></table></div></td><script language="JavaScript">
    <input class="SYN_LNN" type="label" value="215" /><input class="SYN_BCH" id="syn_ctrl215" role="button" type="label" value="-" />
    var g_sImageRoot = "/p2pd/skins/corporate/shared/images/";
    <input class="SYN_LNN" type="label" value="216" /><input class="SYN_BCH" id="syn_ctrl216" role="button" type="label" value="-" />

    </script><script language="javascript" src="/p2pd/ps/portal/js/tabs.js"></script><td><div id="tabControlLeftContainer" tabindex="0" accesskey="1" class="tabScrollButton" onkeypress="if(event.keyCode==9)return true;tabControlDBLClick('left', event); return true;" onmouseover="tabControlMouseOver(this)" onmouseout="tabControlMouseOut(this)" ondblclick="tabControlDBLClick('left', event); return true;" onmousedown="tabControlPress('left', event); return true;" onmouseup="tabControlRelease(); return true;" title="Scroll left"><img id="tabControlLeft" src="/p2pd/skins/corporate/shared/images/action_scroll_left.gif" title="Scroll left" alt="Scroll left"></div></td><td><div id="tabControlRightContainer" tabindex="0" accesskey="1" class="tabScrollButton" onkeypress="if(event.keyCode==9)return true;tabControlDBLClick('right', event); return true;" onmouseover="tabControlMouseOver(this)" onmouseout="tabControlMouseOut(this)" ondblclick="tabControlDBLClick('right', event); return true;" onmousedown="tabControlPress('right', event); return true;" onmouseup="tabControlRelease(); return true;" title="Scroll right"><img id="tabControlRight" src="/p2pd/skins/corporate/shared/images/action_scroll_right.gif" title="Scroll right" alt="Scroll right"></div></td></tr></table></div></td></tr></table><table width="100%" border="0" cellpadding="0" cellspacing="3"><tr><td valign="middle" width="100%" class="dialogHeaderText"><span class="pathLeafNode">Public Folders</span></td><td width="100%"><img

    My code to go to "My Folders" is as follows:

    Dim colLinks
    Set colLinks = oIE.Document.getElementsByTagName("a")
    For Each objLink In colLinks
    If (objLink = "My Folders")
    Then
    objIE.Navigate objLink.href
    Exit For
    End If
    Next

    'the code does not  work

    Any help is appreciated.

    Regards,

    Manas


    Friday, August 8, 2014 1:00 PM
  • I want to navigate through a cognos web page. There are images and words with links on the page.

    the source code is as follows:

    <div id="tabscontroldiv" class="tabMenuButtonNormal" style=" cursor:pointer;" onmouseover="this.className='tabMenuButtonOver'" onmouseout="this.className='tabMenuButtonNormal'"><div tabindex="0" accessKey="1" onkeypress="return CCPopupMenu.dropDown(event,0,0,'TabsMenu');" onclick="return CCPopupMenu.dropDown(event,0,0,'TabsMenu');"><span style="cursor:pointer; "><img style="vertical-align: absmiddle; " name="pageMenu_imgFlyControl" src="/p2pd/skins/corporate/portal/images/page_menu.gif" alt="Tab Menu" title="Tab Menu"></span></div></div></td><td valign="bottom" width="100%" style="padding-"><div class="tabBarContainer"><table cellspacing="0" cellpadding="0" width="100%"><tr><td valign="bottom" style="width:100%;"><div id="tabWindow" onresize="tabEvalScroll();" style="width:100%;><table cellpadding="0" cellspacing="0" border="0" width="100%" id="tabs"><tr><td><div class="tabLeftSelected"></div></td><td nowrap class="tabSelected"><div id="selectedTab" style="">Public Folders</div></td><td><div class="tabRightSelected"></div></td><td valign="bottom"><div class="tabSpacer"></div></td><td><div class="tabLeftNormal"></div></td><td nowrap class="tabNormal"><a class="tabAnchor" onmouseover="window.status='';return true;" onmouseout="window.status='';return true;" href="/p2pd/servlet/dispatch?b_action=xts.run&m=portal/cc.xts&m_tab=iE5E52C5C54EC49CCA0E85D6FBE32E428&m_folder=iE5E52C5C54EC49CCA0E85D6FBE32E428&m_folder2=p-i7B94D6DCADA444CA9215FF52C9889832">My Folders</a></td><td><div class="tabRightNormal"></div></td><td class="tabTail">&nbsp;</td></tr></table></div></td><script language="JavaScript">
    <input class="SYN_LNN" type="label" value="215" /><input class="SYN_BCH" id="syn_ctrl215" role="button" type="label" value="-" />
    var g_sImageRoot = "/p2pd/skins/corporate/shared/images/";
    <input class="SYN_LNN" type="label" value="216" /><input class="SYN_BCH" id="syn_ctrl216" role="button" type="label" value="-" />

    </script><script language="javascript" src="/p2pd/ps/portal/js/tabs.js"></script><td><div id="tabControlLeftContainer" tabindex="0" accesskey="1" class="tabScrollButton" onkeypress="if(event.keyCode==9)return true;tabControlDBLClick('left', event); return true;" onmouseover="tabControlMouseOver(this)" onmouseout="tabControlMouseOut(this)" ondblclick="tabControlDBLClick('left', event); return true;" onmousedown="tabControlPress('left', event); return true;" onmouseup="tabControlRelease(); return true;" title="Scroll left"><img id="tabControlLeft" src="/p2pd/skins/corporate/shared/images/action_scroll_left.gif" title="Scroll left" alt="Scroll left"></div></td><td><div id="tabControlRightContainer" tabindex="0" accesskey="1" class="tabScrollButton" onkeypress="if(event.keyCode==9)return true;tabControlDBLClick('right', event); return true;" onmouseover="tabControlMouseOver(this)" onmouseout="tabControlMouseOut(this)" ondblclick="tabControlDBLClick('right', event); return true;" onmousedown="tabControlPress('right', event); return true;" onmouseup="tabControlRelease(); return true;" title="Scroll right"><img id="tabControlRight" src="/p2pd/skins/corporate/shared/images/action_scroll_right.gif" title="Scroll right" alt="Scroll right"></div></td></tr></table></div></td></tr></table><table width="100%" border="0" cellpadding="0" cellspacing="3"><tr><td valign="middle" width="100%" class="dialogHeaderText"><span class="pathLeafNode">Public Folders</span></td><td width="100%"><img

    My code to go to "My Folders" is as follows:

    Dim colLinks
    Set colLinks = oIE.Document.getElementsByTagName("a")
    For Each objLink In colLinks
    If (objLink = "My Folders")
    Then
    objIE.Navigate objLink.href
    Exit For
    End If
    Next

    'the code does not  work properly

    Any help is appreciated.

    Regards,

    Manas

    Friday, August 8, 2014 1:09 PM
  • Try to look into the MSXML Object, as Cognos files are basically XML files.

    See also this link about MSXML of MSDN:

    MSXML Object

    Hope this helps,


    Daniel van den Berg | Washington, USA | "Anticipate the difficult by managing the easy"

    Please vote an answer helpful if they helped. Please mark an answer(s) as an answer when your question is being answered.

    Tuesday, September 16, 2014 5:24 AM
    Moderator