I am barely new with the webbrowser, webrequest & webresponse. I am now trying to capture the source code on the webbrowser .
I had tried to use webbrowser.documentText and only get the partial source code – I guess it is the main frame and there are some other frames or something else that preventing me to get the source. I can view the source on the IE/Firefox but, with clicking at the different area of the page.
Below is the source I catch with webbrowser.documentText: I really need someone to help me out -- I had try for two weeks without success.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<head>
<title>SigmaQuest Menu</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Pragma" content="no-cache" />

<link rel="stylesheet" href="css/style.css?cache=0911.18"/>
<link rel="stylesheet" href="css/menu/menu.css?cache=0911.18"/>
<script type="text/javascript" src="script/DateChecker.js?cache=0911.18"></script>
<script type="text/javascript" src="script/FirstFocus.js?cache=0911.18"></script>
<script type="text/javascript" src="script/MM_openBrWindow.js?cache=0911.18"></script>
<script type="text/javascript" src="script/goToURL.js?cache=0911.18"></script>
<script type="text/javascript" src="script/UpdateSubmit.js?cache=0911.18"></script>
<script type="text/javascript" src="script/MM_findObj.js?cache=0911.18"></script>
<script type="text/javascript">

function setLoading(url)
{
var img = document.getElementById("progress");
if(img)
{
img.src = url;
}
}
function show_loading()
{
setLoading('img/dashboard/indicator.gif');
}

function hide_loading()
{
setLoading('img/dashboard/blank.png');
}

// This function first determines which the frame that contains dataselector form, then submits it.
function CheckAndsubmit()
{
if (top.content.main.pane.mainChart)
{
top.content.main.pane.mainChart.submit();
}
else if (top.content.main.pane)
{
top.content.main.pane.submit();
}
}

function youraccount()
{
var mywindow = window.open('User.do?op=editMyAccount&id=10122103384', 'windName','width=500,height=200,alwaysRaised=true,menubar=0,toolbar=0,scrollbars=1,status=1,resizab le=1');
var topWidow = top;
while(topWidow.opener != null)
{
topWidow = topWidow.opener.top;
}
topWidow.data.updateWindowArray(mywindow);
mywindow.focus();
}

function serversettings()
{
var mywindow = window.open('ServerSetting.do', 'serversetting','alwaysRaised=true,menubar=0,toolbar=0,scrollbars=1,status=1,resizable=1');
var topWidow = top;
while(topWidow.opener != null)
{
topWidow = topWidow.opener.top;
}
topWidow.data.updateWindowArray(mywindow);
mywindow.focus();
}

function yoursettings()
{
var mywindow = window.open('UserSetting.do', 'usersetting','alwaysRaised=true,menubar=0,toolbar=0,scrollbars=1,status=1,resizable=1');
var topWidow = top;
while(topWidow.opener != null)
{
topWidow = topWidow.opener.top;
}
topWidow.data.updateWindowArray(mywindow);
mywindow.focus();
}


function showQueries()
{
var aImg = MM_findObj("ALERT_IMG");
var loc = aImg.src;
if(loc.indexOf('warning') != -1)
{
var mywindow = window.open('main/cache/ConnectionPool.jsp', 'usersetting','alwaysRaised=true,menubar=0,toolbar=0,scrollbars=1,status=1,resizable=1');
var topWidow = top;
while(topWidow.opener != null)
{
topWidow = topWidow.opener.top;
}
topWidow.data.updateWindowArray(mywindow);
mywindow.focus();
}
}

var selectedDivName = 'subMenu221';
//For storing subMenu Ids
var subMenuIdArray = new Array(

'subMenu221',

'subMenu222',

'subMenu223',

'subMenu224',

'subMenu225',

'subMenu233',

'subMenu234',

'subMenu227',

'subMenu235',

'subMenu228'

);


function selectSubMenu(divName, contextChart, menu, subMenu, targetUrl)
{
show_loading();
//deselect all subMenus
for (var i=0; i < subMenuIdArray.length; i++)
{
var id = subMenuIdArray[i];
document.getElementById(id).className = '';
}
// select the active subMenu
document.getElementById(divName).className='selected';

//---- disable Update for Process Control and search attachment


if(selectedDivName == "")
{
return;
}
var relativeBaseURL = '/harmonic/';
var relativeTargetURL = relativeBaseURL + targetUrl;

// (SA-149) if we don't have the tree frame (e.g. we're in MTF) and we're going to need it, then load it up!
// NOTE: THIS DID NOT WORK, LEAVING THE CODE HERE FOR FUTURE REFERENCE.
// SOLUTIONS:
// 1) Complete rewrite
// 2) Force user to go to UR List first
// 3) Refresh entire page
// 4) New custom action to load any analysis subtab correctly???
//if (!(top.content.main.treeFrameset) && menu == 'analysis' && subMenu != 'manualtestforms')
//{
// contextChart, menu, submenu
//var mainURLDest = relativeBaseURL + '/main/screens/unitreport/Frame.jsp?contextChart=' + contextChart + '&menu='+ menu + '&subMenu=' + subMenu;
//top.content.main.document.location = mainURLDest;
//return;
//top.content.main.document.location = relativeTargetURL + '?contextChart=' + contextChart + '&menu='+ menu + '&subMenu=' + subMenu;
//top.content.main.document.location = 'mainFrame.do?contextChart=' + contextChart + '&menu='+ menu + '&subMenu=' + subMenu;
//}
//else

if(subMenu == 'reports')
{
if( top.content.main.treeFrameset )
top.content.main.pane.document.location = 'UnitReportListAction.do?contextChart=' + contextChart + '&menu='+ menu + '&subMenu=' + subMenu;
else
top.content.main.document.location = relativeTargetURL + '?contextChart=' + contextChart + '&menu='+ menu + '&subMenu=' + subMenu;
}
else if(subMenu == 'charts' || subMenu == 'wizards' || subMenu == 'SEARCHATTACHMENT' || subMenu == 'ERRORANALYSIS')
{
if( top.content.main.treeFrameset )
top.content.main.pane.document.location = 'ChartsAction.do?contextChart=' + contextChart + '&menu='+ menu + '&subMenu=' + subMenu;
else
top.content.main.document.location = relativeTargetURL + '?contextChart=' + contextChart + '&menu='+ menu + '&subMenu=' + subMenu;
}
else if(subMenu == 'manualtestforms' || (menu == 'genealogy' && (subMenu == 'genealogyreports' || subMenu == 'manualgenealogyforms')))
{
top.content.main.document.location = relativeTargetURL;
}
else
{
if(menu == 'analysis')
{
if( !top.content.main.treeFrameset )
{
relativeTargetURL = relativeBaseURL + "/main/screens/unitreport/Frame.jsp";
top.content.main.document.location = relativeTargetURL + '?contextChart=' + contextChart + '&menu='+ menu + '&subMenu=' + subMenu;
}
else if(top.content.main.pane)
{
top.content.main.pane.document.location = 'mainFrame.do?contextChart=' + contextChart + '&menu='+ menu + '&subMenu=' + subMenu;
}
else if(subMenu == 'parametrics' || subMenu == 'processControl')
{
top.content.main.document.location = 'menu.do?rnd=0.8698848005107441&contextChart=' + contextChart + '&menu='+ menu ;
}
}
else
{
if(targetUrl.indexOf('?') < 0)
{
top.content.main.document.location = relativeTargetURL + '?contextChart=' + contextChart + '&menu='+ menu + '&subMenu=' + subMenu;
}
else
{
top.content.main.document.location = relativeTargetURL + '&contextChart=' + contextChart + '&menu='+ menu + '&subMenu=' + subMenu;
}
}
}

if (top.content.main.treeFrameset)
{
// if tree exists, refresh the typeofdata frame to the new context
top.content.main.treeFrameset.TypeofDataFrame.document.location = 'TypeOfDataFrame.do?contextChart=' + contextChart + '&menu='+ menu + '&subMenu=' + subMenu;
top.content.main.treeFrameset.DateFrame.showHideUpdateButton(subMenu);
}

selectedDivName = divName;
}

function doLogout()
{
if (top.data && top.data.closeAllwindows)
top.data.closeAllwindows();
top.location = 'logout.do';
}

function init()
{
show_loading();
goToTopURL('/harmonic/mainFrame.do?contextChart=reports&menu=analysis&subMenu=reports&rand=0.2693773525492823');

}
function help()
{
w=window.open("help/manuals/wrapper/custom/FrameSet.jsp?id=h", "help", "width=800,height=600,scrollbars=yes,resizable=yes,status=no,location=no,toolbar=no,menubar=no") ;
w.focus();
}

</script>



</head>

<body onload="javascript:init()">
<div class="container">
<div class="logo" style="float: left"><img alt="Camstar Logo" src="img/logo.jpg" onclick="javascript:window.open('http://www.camstar.com');"/></div>

<div class="header">
<p><span class="">Welcome, SheauYun Ung!</span>&nbsp;[&nbsp;<a class="logout" href="javascript:doLogout()">logout</a>&nbsp;]</p>
<ul class="menu">
<li><a class="" href="javascript:youraccount();">Profile</a></li>
<li><a class="" href="javascript:yoursettings();">User Settings</a></li>


<li><a class="" href="javascript:help();">Help</a></li>
<li><img id="progress" src="img/dashboard/blank.png" /></li>
</ul>
</div>

<ul class="menu main-menu">

<li >

<a href="/harmonic/menu.do?menu=dashboard&amp;rand=0.7961243198739852 " onclick="top.data.startRequest();" >
Dashboard
</a>
</li>

<li class="selected">

<a href="/harmonic/menu.do?menu=analysis&amp;rand=0.3841190017120414 " onclick="top.data.startRequest();" class="selected">
Supply Chain
</a>
</li>

<li >

<a href="/harmonic/menu.do?menu=Repair+Analysis&amp;rand=0.2874393868121573 " onclick="top.data.startRequest();" >
Repair
</a>
</li>

<li >

<a href="/harmonic/menu.do?menu=RMA+Analysis&amp;rand=0.002386673588599786 " onclick="top.data.startRequest();" >
RMA
</a>
</li>

</ul>
<ul class="menu sub-menu">
<li></li>



<li>
<a href="#" id="subMenu221" class="selected"
onclick="javascript:selectSubMenu('subMenu221', 'reports', 'analysis', 'reports', '/main/screens/unitreport/Frame.jsp')">
Summary
</a>
</li>

<li>
<a href="#" id="subMenu222"
onclick="javascript:selectSubMenu('subMenu222', 'charts', 'analysis', 'charts', '/main/screens/unitreport/Frame.jsp')">
Charts
</a>
</li>

<li>
<a href="#" id="subMenu223"
onclick="javascript:selectSubMenu('subMenu223', 'parametrics', 'analysis', 'parametrics', '/main/screens/chart/ParametricFrame.jsp')">
Parametrics
</a>
</li>

<li>
<a href="#" id="subMenu224"
onclick="javascript:selectSubMenu('subMenu224', 'wizards', 'analysis', 'wizards', '/main/screens/unitreport/Frame.jsp')">
Wizards
</a>
</li>

<li>
<a href="#" id="subMenu225"
onclick="javascript:selectSubMenu('subMenu225', 'processcontrol', 'analysis', 'processControl', '/SpcFrameAction.do')">
Process Control
</a>
</li>

<li>
<a href="#" id="subMenu233"
onclick="javascript:selectSubMenu('subMenu233', 'management', 'analysis', 'management', '/TestSummaryAllReportAction.do?o=s')">
Reports
</a>
</li>

<li>
<a href="#" id="subMenu234"
onclick="javascript:selectSubMenu('subMenu234', 'pbreports', 'analysis', 'pbreports', '/OneClickReport.do?method=begin')">
Push Button Report
</a>
</li>

<li>
<a href="#" id="subMenu227"
onclick="javascript:selectSubMenu('subMenu227', 'pfv', 'analysis', 'pfv', '/pfv/pfventry.do')">
Process Flow
</a>
</li>

<li>
<a href="#" id="subMenu235"
onclick="javascript:selectSubMenu('subMenu235', 'manualtestforms', 'analysis', 'manualtestforms', '/main/screens/manualtestforms/Frame.jsp')">
Test Forms
</a>
</li>

<li>
<a href="#" id="subMenu228"
onclick="javascript:selectSubMenu('subMenu228', 'timeanalysis', 'analysis', 'timeanalysis', '/TimeAnalysis/TimeAnalysisEntry.do')">
Time Analysis
</a>
</li>


<li></li>
</ul>



</div>

</body>
</html>



There are suggestions of using innerhtml/outerhtml but, it will not works too…. I only get the following for all three frames that appear on the main source
<BODY onbeforeunload=sendLogout();></BODY>
<FRAME noResize src="/harmonic/menu.do" name=menu scrolling=no><FRAME src="/harmonic/mainFrame.do" name=main>
<FRAMESET frameSpacing=0 frameBorder=0 rows=87,*><FRAME noResize src="/harmonic/menu.do" name=menu scrolling=no><FRAME src="/harmonic/mainFrame.do" name=main></FRAMESET>
<BODY></BODY>