Excel Web Query from JavaScript Source

oddball508

New Member
Joined
Mar 14, 2006
Messages
1
I have a number of MFDs (Multi function Devices - Printer/Copiers) on the network that display information such as copy counts via an interanet page. I would like to use Excel web query to collect and summerise this info but the pages look to have javascript in them. Anyone had a similar problem or a solution?

To add to this it looks like the pages have frames. If I look at the view/source direct from the url I get;

<HTML><HEAD>
<TITLE></TITLE>
</HEAD>
<frameset ROWS="80,30,*, 20 " framespacing="0" frameborder="0" border="0" width="700" framespacing="0">
<frame name="TopMenu" SRC="/TopAccess/Counter/TopMenu.htm" width="100%" marginheight="0" marginwidth="0" frameborder="0" border="0" scrolling="no" noresize framespacing="0">
<frame name="SubMenu" SRC="/TopAccess/Counter/TotalCount/SubMenu.htm" width="100%" frameborder="0" framespacing="0" marginheight="0" marginwidth="0" scrolling="no" noresize>
<frame name="Contents" SRC="/TopAccess/Counter/TotalCount/List.htm" width="700" frameborder="0" framespacing="0" marginheight="0" marginwidth="8" scrolling="auto">
<frame name="Footer" SRC="/TopAccess/Footer.htm" width="700" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" noresize>
</frameset></html>

But if I view source from near the required data I get;


<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<LINK REL="stylesheet" TYPE="text/css" HREF="/TopAccess/style.css">
<SCRIPT LANGUAGE="JavaScript">
function fnnPopulateTotalCountTable(sTableData)
{
// reddy modifies 10/03/03 for ROM15 bug 16
//Just in case if server returns no table data
if(sTableData == "")
return;
larrRows = sTableData.split("},"); /* sTableData is splitted based on delimiter '},' and returns an array of rows */
/*
* strip off the unwanted '{' and '}'
*/

for(var i=0;i<larrRows.length;i++)
{
larrRows = larrRows.replace(/{|}/ig,"");
}

larrCells = new Array(larrRows.length);
/*
* Split each row on the basis of delimiter ',' into cells
*/
for(var j=0;j<larrRows.length;j++)
{
larrCells[j] = larrRows[j].split(",");
}

/*
* Populate the Table
*/
var k = 0;

for (var i=0; i<larrCells.length; i++)
{
document.write("<TR>");

for (var j=k; j< larrCells.length;j++)
{
if(j==0)
{

document.write("<TD CLASS=clsSubHeader nowrap> "+ larrCells[j] + "</TD>");
}

else
{
document.write("<TD CLASS=clsBTableElement nowrap> "+ larrCells[j] + "</TD>");

}

}
document.write("</TR>");
}
}
</SCRIPT>

</HEAD>

<BODY BGCOLOR="white" CLASS=clsMargin>
<SPAN CLASS="clsTitle1">
Total Count

</SPAN>


<TABLE><TR><TD CLASS="clsBoldTableHeader">Print Counter</TD></TR></TABLE>
<TABLE BORDER=2 BORDER="1" CELLSPACING="0" CELLPADDING="2" WIDTH="700">
<TR>
<TD WIDTH=20% CLASS="clsSubHeader">
 
</TD>
<TD WIDTH=15% CLASS="clsSubHeader">
Copy
</TD>
<TD WIDTH=15% CLASS="clsSubHeader">
Fax
</TD>
<TD WIDTH=15% CLASS="clsSubHeader">
Printer
</TD>
<TD WIDTH=15% CLASS="clsSubHeader">
List
</TD>
<TD WIDTH=15% CLASS="clsSubHeader">
Total
</TD>
</TR>
<SCRIPT LANGUAGE = "javascript">
szTableData = new String("{Full Color,1302,-,9902,-,11204},{Twin Color,0,-,-,-,0},{Black,9850,1,6027,40,15918}");
fnnPopulateTotalCountTable(szTableData);
</SCRIPT>
</TABLE>



<TABLE><TR><TD CLASS="clsBoldTableHeader">Print Counter(small paper)</TD></TR></TABLE>
<TABLE BORDER=2 BORDER="1" CELLSPACING="0" CELLPADDING="2" WIDTH="700">
<TR>
<TD WIDTH=20% CLASS="clsSubHeader">
 
</TD>
<TD WIDTH=15% CLASS="clsSubHeader">
Copy
</TD>
<TD WIDTH=15% CLASS="clsSubHeader">
Fax
</TD>
<TD WIDTH=15% CLASS="clsSubHeader">
Printer
</TD>
<TD WIDTH=15% CLASS="clsSubHeader">
List
</TD>
<TD WIDTH=15% CLASS="clsSubHeader">
Total
</TD>
</TR>
<SCRIPT LANGUAGE = "javascript">
szTableData = new String("{Full Color,1067,-,7430,-,8497},{Twin Color,0,-,-,-,0},{Black,9249,1,4490,40,13780}");
fnnPopulateTotalCountTable(szTableData);
</SCRIPT>
</TABLE>


<TABLE><TR><TD CLASS="clsBoldTableHeader">Print Counter(large paper) </TD></TR></TABLE>
<TABLE BORDER=2 BORDER="1" CELLSPACING="0" CELLPADDING="2" WIDTH="700">
<TR>
<TD WIDTH=20% CLASS="clsSubHeader">
 
</TD>
<TD WIDTH=15% CLASS="clsSubHeader">
Copy
</TD>
<TD WIDTH=15% CLASS="clsSubHeader">
Fax
</TD>
<TD WIDTH=15% CLASS="clsSubHeader">
Printer
</TD>
<TD WIDTH=15% CLASS="clsSubHeader">
List
</TD>
<TD WIDTH=15% CLASS="clsSubHeader">
Total
</TD>
</TR>

<SCRIPT LANGUAGE = "javascript">
szTableData = new String("{Full Color,235,-,2472,-,2707},{Twin Color,0,-,-,-,0},{Black,601,0,1537,0,2138}");
fnnPopulateTotalCountTable(szTableData);
</SCRIPT>
</TABLE>



<TABLE><TR><TD CLASS="clsBoldTableHeader">Scan Counter</TD></TR></TABLE>
<TABLE BORDER=2 BORDER="1" CELLSPACING="0" CELLPADDING="2" WIDTH="700">
<TR>
<TD WIDTH=20% CLASS="clsSubHeader">
 
</TD>
<TD WIDTH=20% CLASS="clsSubHeader" >
Copy
</TD>
<TD WIDTH=20% CLASS="clsSubHeader" >
Network
</TD>
<TD WIDTH=20% CLASS="clsSubHeader">
Fax
</TD>
<TD WIDTH=20% CLASS="clsSubHeader">
Total
</TD>
</TR>
<SCRIPT LANGUAGE = "javascript">
szTableData = new String("{Full Color,895,496,-,1391},{Twin Color,0,-,-,0},{Black,6605,163,45,6813}");
fnnPopulateTotalCountTable(szTableData);
</SCRIPT>
</TABLE>





</BODY>
</HTML>
<!--

-->
 

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top