[Tutor] get javascript output data from ssi file

Derek Smith DerekSmith at racksquared.com
Mon Nov 27 16:24:34 EST 2017


I have not found a way into my tape library from the manufacture IBM, there's no command-line or api I am aware of nor is google. I need to get what this library thinks is its tape volumes inventory.  I have used chrome to view the code and its using adobe's SSI files which then calls a jscript.  Does python provide any way into this tricky application?  I tried cURL but from my understanding it will not provide such data since its pulls markup.  Below is the code in a file called move_element_operations.ssi according to chromes inspect command via right-click.  The volume listing and volumes are highlighted.

Thx in advance!!


<HTML>
                <HEAD>
                                <META HTTP-EQUIV="Refresh" CONTENT="9999">
                                <TITLE></TITLE>
                                <LINK href="style.css" rel="stylesheet" type="text/css">
                                <LINK href="ibm.css" rel="stylesheet" type="text/css">
                                <SCRIPT LANGUAGE="javascript">
                                                function actionConfirm()
                                                {
                                                                return confirm('Are you sure?');
                                                }

                                                function actionSamePartitionConfirm(source,destination)
                                                {
                                                                /* different logocal libraries, no mailslot to mailslot move */
                                                                if( (source[3] != destination[3])
                                                                                && !((source[1].toUpperCase() == "M") && (destination[1].toUpperCase() == "M"))
                                                                                && !(destination[1].toUpperCase() == "M") && (source[3] != 9))
                                                                {
                                                                                return confirm( "Movement between Partitions, are you sure?" );
                                                                }
                                                                else return true;
                                                }

                                                function preMoveCheck()
                                                {
                                                                //get currently selected items
                                                                destIndex = -1;
                                                                sourceIndex = -1;
                                                                while( document.getElementsByName("unique_table_radio1")[++sourceIndex].checked == false )
                                                                {
                                                                                if( document.getElementsByName("unique_table_radio1")[sourceIndex + 1] == null )
                                                                                {
                                                                                                sourceIndex = -1;
                                                                                                break;
                                                                                }
                                                                }
                                                                while( document.getElementsByName("unique_table_radio0")[++destIndex].checked == false )
                                                                {
                                                                                if( document.getElementsByName("unique_table_radio0")[destIndex + 1] == null )
                                                                                {
                                                                                                destIndex = -1;
                                                                                                break;
                                                                                }
                                                                }

                                                                if( (sourceIndex > -1) && (destIndex > -1) )
                                                                {
                                                                                //extract data
                                                                                var searchString = /([A-Z])(\d+)_(\d)_(\d)/;
                                                                                source = searchString.exec( document.getElementsByName("unique_table_radio1")[sourceIndex].value );
                                                                                destination = searchString.exec( document.getElementsByName("unique_table_radio0")[destIndex].value );

                                                                                if( (source != null) && (destination != null) )
                                                                                {
                                                                                                //alert( source[0] + " " + source[1] + " " + source[2] + " " + source[3] + " " + source[4] );
                                                                                                //alert( destination[0] + " " + destination[1] + " " + destination[2] + " " + destination[3] + " " + destination[4] );
                                                                                                if( actionSamePartitionConfirm(source,destination) )
                                                                                                {
                                                                                                                return true;
                                                                                                }
                                                                                                else
                                                                                                {
                                                                                                                return false;
                                                                                                }

                                                                                }
                                                                                else
                                                                                {
                                                                                                return true;
                                                                                }
                                                                }
                                                                else
                                                                {
                                                                                return true;
                                                                }
                                                }

                                </SCRIPT>
                </HEAD>

                <BODY class="main">

                                <FORM name="device_form" action="/RMUMoveElements" method="POST">
<INPUT type="hidden" id="CSRFToken" name="CSRFToken" value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" >
<TABLE border="0" align="center">
              <TR>
                  <TD valign="top" align="center" width="45%">
<div style="font-size:small; font-weight:bold">Source</div>
<div class="headerOuter" id="uniqueTableId1_headerDiv" style="height: 23px;width:220px;"><div class="headerInner">
<div style="width:40px; height: 23px;" class="columnHeader"><div class="spacerPad"></div></div>
<div style="width:78px; height: 23px;" class="columnHeader"><div class="spacerPad">Element</div></div>
<div style="width:98px; height: 23px; border-right:0px;" class="columnHeader"><div class="spacerPad">Volume Serial</div></div>
                      </div></div>
<div class="scrollingTable" id="uniqueTableId1_scrollingTableDiv" style="height: 300px;width:220px;">
<table id="uniqueTableId1" class="tableScrollable tableWithCheckbox" border="1" cellpadding="0" cellspacing="0" align="center"  width="100%">
                              <thead>
<tr class="rowWithReaderCaption">
<th class="cellWithCheckbox" width="40px"><input tableid="uniqueTableId1" type="checkbox"></th>
                                      <th width="78px"> Element</th>
                                      <th width="98px">Volume Serial</th>
                                  </tr>
                              </thead>
                              <tbody>
<tr id="uniqueTableId1_dummyRow" class="rowEmpty">
                                      <td width="40px"><div> </div></td>
                                      <td width="78px"><div></div></td>
                                      <td width="98px"><div></div></td>
                                  </tr>

<TR class="rowAlternatingColor" >
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="D0_0_5"></TD>
         <TD width="78px">Drive 1 (1)</TD>
           <TD width="98px">R20122L5</TD>
      </TR>
       <TR class="">
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="D1_0_5"></TD>
         <TD width="78px">Drive 2 (1)</TD>
           <TD width="98px">R20277L5</TD>
      </TR>

<TR class="rowAlternatingColor" >
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="D2_0_5"></TD>
         <TD width="78px">Drive 3 (1)</TD>
           <TD width="98px">R20265L5</TD>
      </TR>
      <TR class="">
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S1_0_5"></TD>
<TD width="78px">Slot 1 (1)</TD>
          <TD width="98px">R20435L5</TD>
     </TR>
<TR class="rowAlternatingColor" >
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S2_0_5"></TD>
<TD width="78px">Slot 2 (1)</TD>
          <TD width="98px">R20061L5</TD>
     </TR>
      <TR class="">
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S3_0_5"></TD>
<TD width="78px">Slot 3 (1)</TD>
          <TD width="98px">R20408L5</TD>
     </TR>
<TR class="rowAlternatingColor" >
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S5_0_5"></TD>
<TD width="78px">Slot 4 (1)</TD>
          <TD width="98px">R20063L5</TD>
     </TR>
      <TR class="">
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S6_0_5"></TD>
<TD width="78px">Slot 5 (1)</TD>
          <TD width="98px">R20218L5</TD>
     </TR>
<TR class="rowAlternatingColor" >
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S7_0_5"></TD>
<TD width="78px">Slot 6 (1)</TD>
          <TD width="98px">R20465L5</TD>
     </TR>
      <TR class="">
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S9_0_5"></TD>
<TD width="78px">Slot 7 (1)</TD>
          <TD width="98px">R20261L5</TD>
     </TR>
<TR class="rowAlternatingColor" >
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S10_0_5"></TD>
<TD width="78px">Slot 8 (1)</TD>
          <TD width="98px">R20561L5</TD>
     </TR>
      <TR class="">
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S12_0_5"></TD>
<TD width="78px">Slot 10 (1)</TD>
          <TD width="98px">R20378L5</TD>
     </TR>
<TR class="rowAlternatingColor" >
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S13_0_5"></TD>
<TD width="78px">Slot 11 (1)</TD>
          <TD width="98px">R20255L5</TD>
     </TR>
      <TR class="">
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S14_0_5"></TD>
<TD width="78px">Slot 12 (1)</TD>
          <TD width="98px">R20445L5</TD>
     </TR>
<TR class="rowAlternatingColor" >
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S15_0_5"></TD>
<TD width="78px">Slot 13 (1)</TD>
          <TD width="98px">R20052L5</TD>
     </TR>
      <TR class="">
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S16_0_5"></TD>
<TD width="78px">Slot 14 (1)</TD>
          <TD width="98px">R20498L5</TD>
     </TR>
<TR class="rowAlternatingColor" >
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S17_0_5"></TD>
<TD width="78px">Slot 15 (1)</TD>
          <TD width="98px">R20345L5</TD>
     </TR>
      <TR class="">
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S18_0_5"></TD>
<TD width="78px">Slot 16 (1)</TD>
          <TD width="98px">R20325L5</TD>
     </TR>
<TR class="rowAlternatingColor" >
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S19_0_5"></TD>
<TD width="78px">Slot 17 (1)</TD>
          <TD width="98px">R20037L5</TD>
     </TR>
      <TR class="">
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S20_0_5"></TD>
<TD width="78px">Slot 18 (1)</TD>
          <TD width="98px">R20272L5</TD>
     </TR>
<TR class="rowAlternatingColor" >
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S21_0_5"></TD>
<TD width="78px">Slot 19 (1)</TD>
          <TD width="98px">R20446L5</TD>
     </TR>
      <TR class="">
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S23_0_5"></TD>
<TD width="78px">Slot 21 (1)</TD>
          <TD width="98px">R20372L5</TD>
     </TR>
<TR class="rowAlternatingColor" >
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S24_0_5"></TD>
<TD width="78px">Slot 22 (1)</TD>
          <TD width="98px">R20121L5</TD>
     </TR>
      <TR class="">
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S26_0_5"></TD>
<TD width="78px">Slot 24 (1)</TD>
          <TD width="98px">R20027L5</TD>
     </TR>
<TR class="rowAlternatingColor" >
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S27_0_5"></TD>
<TD width="78px">Slot 25 (1)</TD>
          <TD width="98px">R20082L5</TD>
     </TR>
      <TR class="">
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S28_0_5"></TD>
<TD width="78px">Slot 26 (1)</TD>
          <TD width="98px">R20347L5</TD>
     </TR>
<TR class="rowAlternatingColor" >
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S29_0_5"></TD>
<TD width="78px">Slot 27 (1)</TD>
          <TD width="98px">R20065L5</TD>
     </TR>
      <TR class="">
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S30_0_5"></TD>
<TD width="78px">Slot 28 (1)</TD>
          <TD width="98px">R20331L5</TD>
     </TR>
<TR class="rowAlternatingColor" >
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S31_0_5"></TD>
<TD width="78px">Slot 29 (1)</TD>
          <TD width="98px">R20296L5</TD>
     </TR>
      <TR class="">
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S35_0_5"></TD>
<TD width="78px">Slot 33 (1)</TD>
          <TD width="98px">R20494L5</TD>
     </TR>
<TR class="rowAlternatingColor" >
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S36_0_5"></TD>
<TD width="78px">Slot 34 (1)</TD>
          <TD width="98px">R20030L5</TD>
     </TR>
      <TR class="">
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S40_0_5"></TD>
<TD width="78px">Slot 38 (1)</TD>
          <TD width="98px">R20373L5</TD>
     </TR>
<TR class="rowAlternatingColor" >
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S41_0_5"></TD>
<TD width="78px">Slot 39 (1)</TD>
          <TD width="98px">R20292L5</TD>
     </TR>
      <TR class="">
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S44_0_5"></TD>
<TD width="78px">Slot 42 (1)</TD>
          <TD width="98px">R20158L5</TD>
     </TR>
<TR class="rowAlternatingColor" >
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S45_0_5"></TD>
<TD width="78px">Slot 43 (1)</TD>
          <TD width="98px">R20578L5</TD>
     </TR>
      <TR class="">
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio1" value="S47_0_1"></TD>
<TD width="78px">Slot 45 *Res* </TD>
          <TD width="98px">CLNU76L1</TD>
     </TR>
                              </tbody>
                          </table>
                      </div>
                      <br>
                  </TD>
                  <TD align="center" width="10%">
<DIV class="setOfButtons">
<DIV class="buttonEnclosure">
<INPUT type="submit" name="move" value="Move >" class="" onclick="return preMoveCheck()" >
<BR><INPUT type="submit" name="Refresh" value="Refresh" class="">
</DIV>
</DIV>
</TD>
                 <TD valign="top" align="center" width="45%">
<div style="font-size:small; font-weight:bold">Destination</div>
<div class="headerOuter" id="uniqueTableId0_headerDiv" style="height: 23px;width:220px;"><div class="headerInner">
<div style="width:40px; height: 23px;" class="columnHeader"><div class="spacerPad"></div></div>
<div style="width:78px; height: 23px;" class="columnHeader"><div class="spacerPad">Element</div></div>
<div style="width:98px; height: 23px; border-right:0px;" class="columnHeader"><div class="spacerPad">Volume Serial</div></div>
                      </div></div>
<div class="scrollingTable" id="uniqueTableId0_scrollingTableDiv" style="height: 300px;width:220px;">
<table id="uniqueTableId0" class="tableScrollable tableWithCheckbox" border="1" cellpadding="0" cellspacing="0" align="center"  width="100%">
                              <thead>
<tr class="rowWithReaderCaption">
<th class="cellWithCheckbox" width="40px"><input tableid="uniqueTableId0" type="checkbox"></th>
                                      <th width="78px"> Element</th>
                                      <th width="98px">Volume Serial</th>
                                  </tr>
                              </thead>
                              <tbody>
<tr id="uniqueTableId0_dummyRow" class="rowEmpty">
                                      <td width="40px"><div> </div></td>
                                      <td width="78px"><div></div></td>
                                      <td width="98px"><div></div></td>
                                  </tr>

<TR class="rowAlternatingColor" >
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio0" value="D3_0_5"></TD>
         <TD width="78px">Drive 4 (1)</TD>
           <TD width="98px"> </TD>
      </TR>
      <TR class="">
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio0"value="M0_9_0"></TD>
<TD width="78px">I/O Station 1</TD>
          <TD width="98px"> </TD>
     </TR>
<TR class="rowAlternatingColor" >
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio0"value="M4_9_0"></TD>
<TD width="78px">I/O Station 2</TD>
          <TD width="98px"> </TD>
     </TR>
      <TR class="">
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio0"value="M8_9_0"></TD>
<TD width="78px">I/O Station 3</TD>
          <TD width="98px"> </TD>
     </TR>
<TR class="rowAlternatingColor" >
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio0" value="S11_0_0"></TD>
<TD width="78px">Slot 9 (1)</TD>
          <TD width="98px"> </TD>
     </TR>
      <TR class="">
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio0" value="S22_0_0"></TD>
<TD width="78px">Slot 20 (1)</TD>
          <TD width="98px"> </TD>
     </TR>
<TR class="rowAlternatingColor" >
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio0" value="S25_0_0"></TD>
<TD width="78px">Slot 23 (1)</TD>
          <TD width="98px"> </TD>
     </TR>
      <TR class="">
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio0" value="S32_0_0"></TD>
<TD width="78px">Slot 30 (1)</TD>
          <TD width="98px"> </TD>
     </TR>
<TR class="rowAlternatingColor" >
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio0" value="S33_0_0"></TD>
<TD width="78px">Slot 31 (1)</TD>
          <TD width="98px"> </TD>
     </TR>
      <TR class="">
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio0" value="S34_0_0"></TD>
<TD width="78px">Slot 32 (1)</TD>
          <TD width="98px"> </TD>
     </TR>
<TR class="rowAlternatingColor" >
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio0" value="S37_0_0"></TD>
<TD width="78px">Slot 35 (1)</TD>
          <TD width="98px"> </TD>
     </TR>
      <TR class="">
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio0" value="S38_0_0"></TD>
<TD width="78px">Slot 36 (1)</TD>
          <TD width="98px"> </TD>
     </TR>
<TR class="rowAlternatingColor" >
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio0" value="S39_0_0"></TD>
<TD width="78px">Slot 37 (1)</TD>
          <TD width="98px"> </TD>
     </TR>
      <TR class="">
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio0" value="S42_0_0"></TD>
<TD width="78px">Slot 40 (1)</TD>
          <TD width="98px"> </TD>
     </TR>
<TR class="rowAlternatingColor" >
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio0" value="S43_0_0"></TD>
<TD width="78px">Slot 41 (1)</TD>
          <TD width="98px"> </TD>
     </TR>
      <TR class="">
<TD class="cellWithCheckbox" width="40px"><input rowselector="yes" type="radio" name="unique_table_radio0" value="S46_0_0"></TD>
<TD width="78px">Slot 44 (1)</TD>
          <TD width="98px"> </TD>
     </TR>
                              </tbody>
                          </table>
                      </div>
                      <br>
</TD></TR></TABLE></FORM>
                </BODY>
</HTML>

Derek Smith  |  Unix/TSM Administrator  | Racksquared Data Centers
':  614-437-4983 * 325 East Spring Street, Columbus, OH 43215
::  dereksmith at racksquared.com  *: www.racksquared.com<http://www.racksquared.com/> |  www.racksquared.jobs<http://www.racksquared.jobs/>

[cid:image003.png at 01D2E9AA.1B9CF8F0]



More information about the Tutor mailing list