SerenityNetworks
Board Regular
- Joined
- Aug 13, 2009
- Messages
- 131
- Office Version
- 365
- Platform
- Windows
I'm trying to manipulate web pages via a VBA macro in Excel. The problem is that the IE window is opened to framed pages and then the menus I need to operate use Yahoo tools. It's not simply the matter of identifying a link and 'clicking' it or submitting a form (which is something I can do on a regular web page).
I used Fiddler2 to watch what happens as I use the web page(s). Here are the steps that get me where I need to be.
STEP 1: I have the main web page open. I know the page has three frames.
When I click on one of the menu items that then displays content on the page I get the following:
STEP 2:
When I submit a button on the page that performs the action I want then I get:
STEP 3: I click on a link in the titleFrame to open a new (application) window. The new pages also has three frames.
Fiddler Returns:
STEP 4:
Now I'm again at the point I want to click a menu item, display content, and do something.
I click on one of the menu items and I get:
The above displays the page content I want to check and manipulate in the "contentFrame". I think once I have the contentFrame populated then I should be okay with doing the rest of what I need to accomplish (validating the page opens, validate the expected content, scraping some of the content, etc.).
SOLUTION ???
I'm hoping that if I can pass the GET (or POST) strings to the page/frame then I can get the contentFrame to display the content I need to examine and manipulate. However, I have no idea of the code I need to accomplish this task. Likewise, being able to call/make the menu function is an option, perhaps by identifying the node number (see code posted below)..
Any help will be GREATLY appreciated.
Thanks in advance,
Andrew
PS. In case it helps. Following is some example code from the menuFrame.
I used Fiddler2 to watch what happens as I use the web page(s). Here are the steps that get me where I need to be.
STEP 1: I have the main web page open. I know the page has three frames.
Code:
Frame name: titleFrame
Frame URL: [URL]http://mydomain.com/Portal/displayTitleBar.do[/URL]
Frame name: menuFrame
Frame URL: [URL]http://mydomain.com/Portal/displayMenu.do?application_id=66[/URL]
Frame name: contentFrame
Frame URL: [URL="http://srtauat.etcchostedservices.local/SSOPortal/jsp/common/default.jsp"]http://mydomain.com/Portal/jsp/common/default.jsp[/URL]
Code:
HEADER:
GET /rc/open_it.do?RSESSIONID=0ad25b6730d6b1c67aa222574d658b16ba010fb0aafc&PSID=mCE62grmL7E3zzwHhxdhfGZczfl6SyPU%2Bn4afn%2Br32NcL2Qq0bkx24v7hmj16NldRvITIIG9GAn30i9yqPAKxw%3D%3D HTTP/1.1
When I submit a button on the page that performs the action I want then I get:
Code:
HEADER:
POST /rc/open_it.do HTTP/1.1
QUERY STRINGS:
myaction = open
openingBalance = 0
open = Open It
Code:
Frame name: titleFrame
Frame URL: [URL]http://mydomain.com/Portal/displayTitleBar.do[/URL]
Frame name: menuFrame
Frame URL: [URL]http://mydomain.com/Portal/displayMenu.do?application_id=44[/URL]
Frame name: contentFrame
Frame URL: [URL]http://mydomain.com/Portal/jsp/common/default.jsp[/URL]
Code:
HEADER:
GET /Portal/displayTitleBar.do HTTP/1.1
GET /Portal/displayMenu.do?application_id=4 HTTP/1.1
GET /Portal/jsp/common/default.jsp HTTP/1.1
Now I'm again at the point I want to click a menu item, display content, and do something.
I click on one of the menu items and I get:
Code:
HEADER:
GET /csc_ui/prefind_account.do?RSESSIONID=0ad25b6730d6b1c67aa222574d658b16ba010fb0aafc&PSID=mCE62grmL7E3zzwHhxdhfGZczfl6SyPU%2Bn4afn%2Br32NcL2Qq0bkx24v7hmj16NldRvITIIG9GAn30i9yqPAKxw%3D%3D HTTP/1.1
SOLUTION ???
I'm hoping that if I can pass the GET (or POST) strings to the page/frame then I can get the contentFrame to display the content I need to examine and manipulate. However, I have no idea of the code I need to accomplish this task. Likewise, being able to call/make the menu function is an option, perhaps by identifying the node number (see code posted below)..
Any help will be GREATLY appreciated.
Thanks in advance,
Andrew
PS. In case it helps. Following is some example code from the menuFrame.
Code:
<LINK rel=stylesheet type=text/css href="/ThisPortal/combined.css.h535080741.pack" charset=utf-8>
******** type="text/javascript" src="/ThisPortal/combined.js.h-1763945181.pack" charset="utf-8">*********>
****** http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<STYLE type=text/css>
/* style exceptions for all IE browsers */
button { width:auto; overflow:visible; }
button span { margin-top:0px; }
</STYLE>
<STYLE type=text/css>
/*margin and padding on body element
can introduce errors in determining
element position and are not recommended;
we turn them off as a foundation for YUI
CSS treatments. */
body {
margin:0;
padding:0;
}
</STYLE>
<!-- Custom style for the expand/contract section-->
<STYLE type=text/css>
#expandcontractdiv {border:1px dotted #dedede; background-color:#EBE4F2; margin:0 0 0 0;}
#treeDiv1 { padding:2px; margin-top:0em; }
.ygtvlabel, .ygtvlabel:link, .ygtvlabel:visited, .ygtvlabel:hover {
margin-left:2px;
text-decoration: none;
font-weight:bold;
background-color: #769FC0;
color: #ffffff;
font-size:8pt;
}
/* first or middle sibling, expandable */
.ygtvtp {
width:1em; height:20px;
cursor:pointer ;
background: url(/UIComponents/js/yui/build/treeview/assets/sprite-menu.gif) -8px -395px no-repeat;
}
/* first or middle sibling, expandable, hover */
.ygtvtph {
width:1em; height:20px;
cursor:pointer ;
background: url(/UIComponents/js/yui/build/treeview/assets/sprite-menu.gif) -8px -475px no-repeat;
}
/* Last sibling, expandable */
.ygtvlp {
width:1em; height:20px;
cursor:pointer ;
background: url(/UIComponents/js/yui/build/treeview/assets/sprite-menu.gif) -8px -395px no-repeat;
}
/* Last sibling, expandable, hover */
.ygtvlph {
width:1em; height:20px; cursor:pointer ;
background: url(/UIComponents/js/yui/build/treeview/assets/sprite-menu.gif) -8px -475px no-repeat;
}
/* first or middle sibling, collapsable */
.ygtvtm {
width:1em; height:20px;
cursor:pointer ;
background: url(/UIComponents/js/yui/build/treeview/assets/sprite-menu.gif) -8px -77px no-repeat;
}
/* first or middle sibling, collapsable, hover */
.ygtvtmh {
width:1em; height:20px;
cursor:pointer ;
background: url(/UIComponents/js/yui/build/treeview/assets/sprite-menu.gif) -8px -157px no-repeat;
}
/* Last sibling, collapsable */
.ygtvlm {
width:1em; height:20px;
cursor:pointer ;
background: url(/UIComponents/js/yui/build/treeview/assets/sprite-menu.gif) -8px -77px no-repeat;
}
/* Last sibling, collapsable, hover */
.ygtvlmh {
width:1em; height:20px;
cursor:pointer ;
background: url(/UIComponents/js/yui/build/treeview/assets/sprite-menu.gif) -8px -157px no-repeat;
}
</STYLE>
<BASE href="<a href=" target=_blank ? ThisPortal%22 mydomain.com https:>https://mydomain.com/ThisPortal"/>
[TABLE]
<TBODY>[TR]
[TD="width: 5"] [/TD]
[TD]
[/TD]
[/TR]
</TBODY>[/TABLE]
******** type="text/javascript">
var myMenuTreetreeDiv1;
myMenuTreetreeDiv1 = new YAHOO.widget.TreeView('treeDiv1');
var node200320 = new YAHOO.widget.MenuNode('New Account', myMenuTreetreeDiv1.getRoot(), false);
var node499 = new YAHOO.widget.MenuNode('New Account Setup', node200320, false);
node499.href="javascript:parent.frames['contentFrame'].location.replace('https://mydomain.com/ui/clear_account.do?RSESSIONID=9f44f3e471baa7e24c02c72c10c26eb66a9f5286d327d1252e49f5dcfa56386d&PSID=QmXO5O7lCAVEYEHz3kVAU2Zczfl6SyPU%252Bn4afn%252Br32N7iFI6I1reNw6BOVoolxLFRvITIIG9GAn30i9yqPAKxw%253D%253D')";
var node200321 = new YAHOO.widget.MenuNode('Violator Search', node200320, false);
node200321.href="javascript:parent.frames['contentFrame'].location.replace('https://mydomain.com/ui/displayViolatorSearch.do?RSESSIONID=9f44f3e471baa7e24c02c72c10c26eb66a9f5286d327d1252e49f5dcfa56386d&PSID=QmXO5O7lCAVEYEHz3kVAU2Zczfl6SyPU%252Bn4afn%252Br32N7iFI6I1reNw6BOVoolxLFRvITIIG9GAn30i9yqPAKxw%253D%253D')";
var node500 = new YAHOO.widget.MenuNode('Account Search', myMenuTreetreeDiv1.getRoot(), false);
node500.href="javascript:parent.frames['contentFrame'].location.replace('https://mydomain/ui/prefind_account.do?RSESSIONID=9f44f3e471baa7e24c02c72c10c26eb66a9f5286d327d1252e49f5dcfa56386d&PSID=QmXO5O7lCAVEYEHz3kVAU2Zczfl6SyPU%252Bn4afn%252Br32N7iFI6I1reNw6BOVoolxLFRvITIIG9GAn30i9yqPAKxw%253D%253D')";
var node300106 = new YAHOO.widget.MenuNode('Account Management', myMenuTreetreeDiv1.getRoot(), false);
var node300107 = new YAHOO.widget.MenuNode('Account Maintenance', node300106, false);
var node300109 = new YAHOO.widget.MenuNode('Account Activity', node300107, false);
node300109.href="javascript:parent.frames['contentFrame'].location.replace('https://mydomain.com/ui/clear_history_search_action.do?myaction=accountActivity&RSESSIONID=9f44f3e471baa7e24c02c72c10c26eb66a9f5286d327d1252e49f5dcfa56386d&PSID=QmXO5O7lCAVEYEHz3kVAU2Zczfl6SyPU%252Bn4afn%252Br32N7iFI6I1reNw6BOVoolxLFRvITIIG9GAn30i9yqPAKxw%253D%253D')";
...
var node200140 = new YAHOO.widget.MenuNode('Notification Forms', myMenuTreetreeDiv1.getRoot(), false);
node200140.href="javascript:parent.frames['contentFrame'].location.replace('https://mydomain.com/ui/preprinted_forms_action.do?RSESSIONID=9f44f3e471baa7e24c02c72c10c26eb66a9f5286d327d1252e49f5dcfa56386d&PSID=QmXO5O7lCAVEYEHz3kVAU2Zczfl6SyPU%252Bn4afn%252Br32N7iFI6I1reNw6BOVoolxLFRvITIIG9GAn30i9yqPAKxw%253D%253D')";
myMenuTreetreeDiv1.draw()
*********>