Windows Vista Forums

get array from html
  1. #1


    at Guest

    get array from html

    Hi,

    With this source code:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <script language="JavaScript">



    var f = document.forms['test'];

    var l = f.land.options.length;
    var provincie = new Array(l);

    for(i = 0; i < l.length; i++){
    provincie[i] = new Array();
    }

    provincie[0][0] = "Kies eerst een land";

    provincie[1][0] = "Kies een";
    provincie[1][1] = "Groningen";
    provincie[1][2] = "Friesland";
    provincie[1][3] = "Drenthe";
    provincie[1][4] = "Gelderland";

    var t = f.provincie;

    function zetProvincies(x){
    for(i = 0; i < provincie[x].length; i++){
    t.options[i] = new Option(provincie[x][i], provincie[x][i]);
    }
    }

    </script>
    </head>
    <body>
    <form id="test" name="test" method="post" action="" >
    <table>
    <tr>
    <td ><font class="content">Land </font></td>
    <td>
    <select name="land" size="1"
    onChange="zetProvincies(this.options.selectedIndex)">
    <option value="0" selected>Geen Selectie</option>
    <option value="1">Nederland</option>
    </select>
    </td>
    </tr>
    <tr>
    <td><font class="content">Provincie </font></td>
    <td>
    <select name="provincie">

    </select>
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>


    How to retrieve or read all arrays "provincie" in vbs ?

    Thx



      My System SpecsSystem Spec

  2. #2


    paulwillekens Guest

    Re: get array from html

    Hi At,

    Though your problem is not stated very clearly, I assume you want to
    retrieve the few dutch provinces as used in the .html ? "all arrays"
    you say, but I see only one...

    If you want a .vbs to extract those 4 provinces, it seems a clear case
    of overkill: just grab them in a text editor...

    If your problem is different, then please state it clearly.

    Kind regards

    Paul Willekens

      My System SpecsSystem Spec

  3. #3


    at Guest

    Re: get array from html

    paulwillekens a formulé ce mardi :

    > Hi At,
    >
    > Though your problem is not stated very clearly, I assume you want to
    > retrieve the few dutch provinces as used in the .html ? "all arrays"
    > you say, but I see only one...
    >
    > If you want a .vbs to extract those 4 provinces, it seems a clear case
    > of overkill: just grab them in a text editor...
    >
    > If your problem is different, then please state it clearly.
    >
    > Kind regards
    >
    > Paul Willekens
    But, with

    Set ie = CreateObject("InternetExplorer.Application")
    ie.navigate "http://www.thepagewithprovinces.com"
    ....


    It's possible to assign directly the Array from javascript into a
    variable in VBS ?

    Or use RegExp ?

    Regard



      My System SpecsSystem Spec

  4. #4


    Paul Randall Guest

    Re: get array from html


    "at" <at@newsgroup> wrote in message
    news:4bcd82cb$0$2962$ba4acef3@newsgroup

    > paulwillekens a formulé ce mardi :

    >> Hi At,
    >>
    >> Though your problem is not stated very clearly, I assume you want to
    >> retrieve the few dutch provinces as used in the .html ? "all arrays"
    >> you say, but I see only one...
    >>
    >> If you want a .vbs to extract those 4 provinces, it seems a clear case
    >> of overkill: just grab them in a text editor...
    >>
    >> If your problem is different, then please state it clearly.
    >>
    >> Kind regards
    >>
    >> Paul Willekens
    >
    > But, with
    >
    > Set ie = CreateObject("InternetExplorer.Application")
    > ie.navigate "http://www.thepagewithprovinces.com"
    > ...
    >
    >
    > It's possible to assign directly the Array from javascript into a
    > variable in VBS ?
    >
    > Or use RegExp ?
    >
    > Regard
    I don't know how to get the JScript array directly transferred to a VBScript
    array. I would have my standalone VBScript load the HTML file in an IE
    object and use the DOM to get at what I want. Of course, sometimes you
    can't get directly to the web page that you are interested in, so you may
    have to set up a way to pause your script while you manually navigate, in
    the script's IE window, to the page of interest, and then have the script do
    its thing of getting the info of interest. A message box works fine for
    pausing the script, and when you continue the script by clicking OK on the
    message box, you will want to get the current IE document with something
    like Set oIEDoc = oIE.Document.

    One fairly quick way to learn about how to manipulate many of the features
    of the HTML DOM is to study a Microsoft HTA that can be used to build other
    HTAs, called HTA Helpomatic. All of its scripting is VBScript. HTAs use
    objects identical to those in HTML. Download it here:
    http://www.microsoft.com/downloads/d...3-ae7b9152e6d9

    The URL is long, so you may have to unwrap it.
    -Paul Randall



      My System SpecsSystem Spec

  5. #5


    at Guest

    Re: get array from html

    Paul Randall a exposé le 20/04/2010 :

    > I don't know how to get the JScript array directly transferred to a VBScript
    > array. I would have my standalone VBScript load the HTML file in an IE
    > object and use the DOM to get at what I want. Of course, sometimes you can't
    > get directly to the web page that you are interested in, so you may have to
    > set up a way to pause your script while you manually navigate, in the
    > script's IE window, to the page of interest, and then have the script do its
    > thing of getting the info of interest. A message box works fine for pausing
    > the script, and when you continue the script by clicking OK on the message
    > box, you will want to get the current IE document with something like Set
    > oIEDoc = oIE.Document.
    >
    > One fairly quick way to learn about how to manipulate many of the features of
    > the HTML DOM is to study a Microsoft HTA that can be used to build other
    > HTAs, called HTA Helpomatic. All of its scripting is VBScript. HTAs use
    > objects identical to those in HTML. Download it here:
    > http://www.microsoft.com/downloads/d...3-ae7b9152e6d9
    >
    > The URL is long, so you may have to unwrap it.
    > -Paul Randall
    In the web page, i found this:

    ....
    var dhcp_data = new Array();
    dhcp_data[0] = new Array(find_userfriendlyname(js_host_list,
    '00:a0:aa:aa:1a:a0'), '192.168.1.18', '00:9a:da:aa:18:a0', null, null);
    dhcp_data[1] = new Array(find_userfriendlyname(js_host_list,
    '00:0e:ee:de:eb:e9'), '192.168.1.19', '00:aa:e4:d7:3b:a9', null, null);
    ....


    I try to read value in dhcp_data[1] with vbscript after load document
    with

    Set ie = CreateObject("InternetExplorer.Application")
    ie.navigate "http://www.example_page.com"
    ....


    it's possible ?

    regard.



      My System SpecsSystem Spec

  6. #6


    Paul Randall Guest

    Re: get array from html


    "at" <at@newsgroup> wrote in message
    news:4bce14a2$0$2946$ba4acef3@newsgroup

    > Paul Randall a exposé le 20/04/2010 :
    >

    >> I don't know how to get the JScript array directly transferred to a
    >> VBScript array. I would have my standalone VBScript load the HTML file
    >> in an IE object and use the DOM to get at what I want. Of course,
    >> sometimes you can't get directly to the web page that you are interested
    >> in, so you may have to set up a way to pause your script while you
    >> manually navigate, in the script's IE window, to the page of interest,
    >> and then have the script do its thing of getting the info of interest.
    >> A message box works fine for pausing the script, and when you continue
    >> the script by clicking OK on the message box, you will want to get the
    >> current IE document with something like Set oIEDoc = oIE.Document.
    >>
    >> One fairly quick way to learn about how to manipulate many of the
    >> features of the HTML DOM is to study a Microsoft HTA that can be used to
    >> build other HTAs, called HTA Helpomatic. All of its scripting is
    >> VBScript. HTAs use objects identical to those in HTML. Download it
    >> here:
    >> http://www.microsoft.com/downloads/d...3-ae7b9152e6d9
    >>
    >> The URL is long, so you may have to unwrap it.
    >> -Paul Randall
    >
    > In the web page, i found this:
    >
    > ...
    > var dhcp_data = new Array();
    > dhcp_data[0] = new Array(find_userfriendlyname(js_host_list,
    > '00:a0:aa:aa:1a:a0'), '192.168.1.18', '00:9a:da:aa:18:a0', null, null);
    > dhcp_data[1] = new Array(find_userfriendlyname(js_host_list,
    > '00:0e:ee:de:eb:e9'), '192.168.1.19', '00:aa:e4:d7:3b:a9', null, null);
    > ...
    >
    >
    > I try to read value in dhcp_data[1] with vbscript after load document
    > with
    >
    > Set ie = CreateObject("InternetExplorer.Application")
    > ie.navigate "http://www.example_page.com"
    > ...
    >
    >
    > it's possible ?
    Here is an HTA example using Evertjan's method:

    <html>
    <head>
    <title>JS Array to VBS array</title>
    <script language="vbscript">
    'Putting this script here prepositions the window.
    'Windowstate=Maximize would override this.
    Const wdDlg = 600, htDlg = 380 ' dialog size
    Const pxLeft = 100, pxTop = 100 ' positioning
    window.ResizeTo wdDlg,htDlg
    window.MoveTo pxLeft,pxTop
    </SCRIPT>
    <HTA:APPLICATION
    ID="Put your ID here"
    APPLICATIONNAME="Put your application name here"
    SCROLL="yes"
    SINGLEINSTANCE="no"
    WINDOWSTATE=""

    >
    </head>

    <SCRIPT Language="JScript">
    var a, b;
    a = new Array(0,1,2,3,4);
    b = a.join("-");

    </SCRIPT>

    <SCRIPT Language="VBScript">
    msgbox b
    myArray = split(b,"-")
    msgbox join(myarray, vbcrlf)
    </SCRIPT>
    <body>
    </body>
    </html>



      My System SpecsSystem Spec

  7. #7


    at Guest

    Re: get array from html

    Paul Randall a exprimé avec précision :

    > "at" <at@newsgroup> wrote in message
    > news:4bce14a2$0$2946$ba4acef3@newsgroup

    >> Paul Randall a exposé le 20/04/2010 :
    >>

    >>> I don't know how to get the JScript array directly transferred to a
    >>> VBScript array. I would have my standalone VBScript load the HTML file in
    >>> an IE object and use the DOM to get at what I want. Of course, sometimes
    >>> you can't get directly to the web page that you are interested in, so you
    >>> may have to set up a way to pause your script while you manually navigate,
    >>> in the script's IE window, to the page of interest, and then have the
    >>> script do its thing of getting the info of interest. A message box works
    >>> fine for pausing the script, and when you continue the script by clicking
    >>> OK on the message box, you will want to get the current IE document with
    >>> something like Set oIEDoc = oIE.Document.
    >>>
    >>> One fairly quick way to learn about how to manipulate many of the features
    >>> of the HTML DOM is to study a Microsoft HTA that can be used to build
    >>> other HTAs, called HTA Helpomatic. All of its scripting is VBScript.
    >>> HTAs use objects identical to those in HTML. Download it here:
    >>> http://www.microsoft.com/downloads/d...3-ae7b9152e6d9
    >>>
    >>> The URL is long, so you may have to unwrap it.
    >>> -Paul Randall
    >>
    >> In the web page, i found this:
    >>
    >> ...
    >> var dhcp_data = new Array();
    >> dhcp_data[0] = new Array(find_userfriendlyname(js_host_list,
    >> '00:a0:aa:aa:1a:a0'), '192.168.1.18', '00:9a:da:aa:18:a0', null, null);
    >> dhcp_data[1] = new Array(find_userfriendlyname(js_host_list,
    >> '00:0e:ee:de:eb:e9'), '192.168.1.19', '00:aa:e4:d7:3b:a9', null, null);
    >> ...
    >>
    >>
    >> I try to read value in dhcp_data[1] with vbscript after load document with
    >>
    >> Set ie = CreateObject("InternetExplorer.Application")
    >> ie.navigate "http://www.example_page.com"
    >> ...
    >>
    >>
    >> it's possible ?
    >
    > Here is an HTA example using Evertjan's method:
    >
    > <html>
    > <head>
    > <title>JS Array to VBS array</title>
    > <script language="vbscript">
    > 'Putting this script here prepositions the window.
    > 'Windowstate=Maximize would override this.
    > Const wdDlg = 600, htDlg = 380 ' dialog size
    > Const pxLeft = 100, pxTop = 100 ' positioning
    > window.ResizeTo wdDlg,htDlg
    > window.MoveTo pxLeft,pxTop
    > </SCRIPT>
    > <HTA:APPLICATION
    > ID="Put your ID here"
    > APPLICATIONNAME="Put your application name here"
    > SCROLL="yes"
    > SINGLEINSTANCE="no"
    > WINDOWSTATE=""

    >>
    > </head>
    >
    > <SCRIPT Language="JScript">
    > var a, b;
    > a = new Array(0,1,2,3,4);
    > b = a.join("-");
    >
    > </SCRIPT>
    >
    > <SCRIPT Language="VBScript">
    > msgbox b
    > myArray = split(b,"-")
    > msgbox join(myarray, vbcrlf)
    > </SCRIPT>
    > <body>
    > </body>
    > </html>
    But you place the VBscript in web page! I want found the array value
    with an external script.

    And the web page contain:

    var dhcp_data = new Array();
    dhcp_data[0] = new Array(find_userfriendlyname(js_host_list,
    '00:a0:aa:aa:1a:a0'), '192.168.1.18', '00:9a:da:aa:18:a0', null, null);
    dhcp_data[1] = new Array(find_userfriendlyname(js_host_list,
    '00:0e:ee:de:eb:e9'), '192.168.1.19', '00:aa:e4:d7:3b:a9', null, null);

    and i try to view value in dhcp_data[1] with the Vbscript launch from
    windows, not in the web page.

    With another example with a internet web page:


    <html>

    <script type='text/javascript'>var js_mbv_dhcpserverenabled = '1';var
    js_mbv_ipinterfaceipaddress = '192.168.1.1';

    </script>

    <body>

    <form method="POST" action="bot">

    <p><input type="text" name="lacase" size="20" value="hello"><input
    type="submit" value="Send" name="B1"><input type="reset" value="Cancel"
    name="B2"></p>

    </form>

    </body>
    </html>



    Now,i can view value "lacase" with a Windows VBScript


    ' VBSCRIPT ------------------
    Set objShell = WScript.CreateObject("WScript.Shell" )
    Set ie = CreateObject("InternetExplorer.Application")
    ie.navigate "d:\example.htm"
    msgbox ie.document.All.tags("input").Item("lacase").Value
    ' --------------------------------

    Now, how to retrieve value in "js_mbv_ipinterfaceipaddress" ?

    Regard.



      My System SpecsSystem Spec

  8. #8


    Tom Lavedas Guest

    Re: get array from html

    On Apr 21, 3:42*am, at <a...@newsgroup> wrote:

    > Paul Randall a exprim avec pr cision :
    >
    >
    >

    > > "at" <a...@newsgroup> wrote in message
    > >news:4bce14a2$0$2946$ba4acef3@newsgroup

    > >> Paul Randall a expos le 20/04/2010 :
    >

    > >>> I don't know how to get the JScript array directly transferred to a
    > >>> VBScript array. *I would have my standalone VBScript load the HTML file in
    > >>> an IE object and use the DOM to get at what I want. *Of course, sometimes
    > >>> you can't get directly to the web page that you are interested in, soyou
    > >>> may have to set up a way to pause your script while you manually navigate,
    > >>> in the script's IE window, to the page of interest, and then have the
    > >>> script do its thing of *getting the info of interest. A message boxworks
    > >>> fine for pausing the script, and when you continue the script by clicking
    > >>> OK on the message box, you will want to get the current IE document with
    > >>> something like Set oIEDoc = oIE.Document.
    >

    > >>> One fairly quick way to learn about how to manipulate many of the features
    > >>> of the HTML DOM is to study a Microsoft HTA that can be used to build
    > >>> other HTAs, called HTA Helpomatic. *All of its scripting is VBScript. *
    > >>> HTAs use objects identical to those in HTML. *Download it here:
    > >>>http://www.microsoft.com/downloads/d...lang=en&Family...
    >

    > >>> The URL is long, so you may have to unwrap it.
    > >>> -Paul Randall
    >

    > >> In the web page, i found this:
    >

    > >> ...
    > >> var dhcp_data = new Array();
    > >> dhcp_data[0] = new Array(find_userfriendlyname(js_host_list,
    > >> '00:a0:aa:aa:1a:a0'), '192.168.1.18', '00:9a:da:aa:18:a0', null, null);
    > >> dhcp_data[1] = new Array(find_userfriendlyname(js_host_list,
    > >> '00:0e:ee:de:eb:e9'), '192.168.1.19', '00:aa:e4:d7:3b:a9', null, null);
    > >> ...
    >

    > >> I try to read value in dhcp_data[1] *with vbscript after load document with
    >

    > >> Set ie = CreateObject("InternetExplorer.Application")
    > >> ie.navigate "http://www.example_page.com"
    > >> ...
    >

    > >> it's possible ?
    >

    > > Here is an HTA example using Evertjan's method:
    >

    > > <html>
    > > <head>
    > > <title>JS Array to VBS array</title>
    > > <script language="vbscript">
    > > 'Putting this script here prepositions the window.
    > > 'Windowstate=Maximize would override this.
    > > Const wdDlg = 600, htDlg = 380 *' dialog size
    > > Const pxLeft = 100, pxTop = 100 *' positioning
    > > * window.ResizeTo wdDlg,htDlg
    > > * window.MoveTo pxLeft,pxTop
    > > </SCRIPT>
    > > <HTA:APPLICATION
    > > * * *ID="Put your ID here"
    > > * * *APPLICATIONNAME="Put your application name here"
    > > * * *SCROLL="yes"
    > > * * *SINGLEINSTANCE="no"
    > > * * *WINDOWSTATE=""
    >

    > > </head>
    >

    > > <SCRIPT Language="JScript">
    > > * *var a, b;
    > > * *a = new Array(0,1,2,3,4);
    > > * *b = a.join("-");
    >

    > > </SCRIPT>
    >

    > > <SCRIPT Language="VBScript">
    > > msgbox b
    > > myArray = split(b,"-")
    > > msgbox join(myarray, vbcrlf)
    > > </SCRIPT>
    > > <body>
    > > </body>
    > > </html>
    >
    > But you place the VBscript in web page! I want found the array value
    > with an external script.
    >
    > And the web page contain:
    >
    > var dhcp_data = new Array();
    > dhcp_data[0] = new Array(find_userfriendlyname(js_host_list,
    > '00:a0:aa:aa:1a:a0'), '192.168.1.18', '00:9a:da:aa:18:a0', null, null);
    > dhcp_data[1] = new Array(find_userfriendlyname(js_host_list,
    > '00:0e:ee:de:eb:e9'), '192.168.1.19', '00:aa:e4:d7:3b:a9', null, null);
    >
    > and i try to view value in dhcp_data[1] with the Vbscript launch from
    > windows, not in the web page.
    >
    > With another example with a internet web page:
    >
    > <html>
    >
    > <script type='text/javascript'>var js_mbv_dhcpserverenabled = '1';var
    > js_mbv_ipinterfaceipaddress = '192.168.1.1';
    >
    > </script>
    >
    > <body>
    >
    > <form method="POST" action="bot">
    >
    > * <p><input type="text" name="lacase" size="20" value="hello"><input
    > type="submit" value="Send" name="B1"><input type="reset" value="Cancel"
    > name="B2"></p>
    >
    > </form>
    >
    > </body>
    > </html>
    >
    > Now,i can view value "lacase" with a Windows VBScript
    >
    > ' * * VBSCRIPT ------------------
    > Set objShell = WScript.CreateObject("WScript.Shell" )
    > Set ie = CreateObject("InternetExplorer.Application")
    > ie.navigate "d:\example.htm"
    > msgbox ie.document.All.tags("input").Item("lacase").Value
    > ' --------------------------------
    >
    > Now, how to retrieve value in "js_mbv_ipinterfaceipaddress" ?
    >
    > Regard.
    Try something like this ...

    Set objShell = WScript.CreateObject("WScript.Shell" )
    Set ie = CreateObject("InternetExplorer.Application")
    ie.navigate "d:\example.htm"
    wsh.echo ie.document.parentWindow.js_mbv_ipinterfaceipaddress

    I think the same approach will access the array variable, but I'm not
    certain whether JScript arrays are compatible with VBScript. Try
    something like this ...

    wsh.echo Join(ie.document.parentWindow.dhcp_data, vbCRLF)
    _____________________
    Tom Lavedas

      My System SpecsSystem Spec

  9. #9


    at Guest

    Re: get array from html

    Tom Lavedas a utilisé son clavier pour écrire :

    > Try something like this ...
    >
    > Set objShell = WScript.CreateObject("WScript.Shell" )
    > Set ie = CreateObject("InternetExplorer.Application")
    > ie.navigate "d:\example.htm"
    > wsh.echo ie.document.parentWindow.js_mbv_ipinterfaceipaddress
    >
    > I think the same approach will access the array variable, but I'm not
    > certain whether JScript arrays are compatible with VBScript. Try
    > something like this ...
    >
    > wsh.echo Join(ie.document.parentWindow.dhcp_data, vbCRLF)
    Thx, i try it, but not work. Regard.



      My System SpecsSystem Spec

  10. #10


    Paul Randall Guest

    Re: get array from html


    "at" <at@newsgroup> wrote in message
    news:4bceabef$0$2973$ba4acef3@newsgroup

    > Paul Randall a exprimé avec précision :

    >> "at" <at@newsgroup> wrote in message
    >> news:4bce14a2$0$2946$ba4acef3@newsgroup

    >>> Paul Randall a exposé le 20/04/2010 :
    >>>
    >>>> I don't know how to get the JScript array directly transferred to a
    >>>> VBScript array. I would have my standalone VBScript load the HTML file
    >>>> in an IE object and use the DOM to get at what I want. Of course,
    >>>> sometimes you can't get directly to the web page that you are
    >>>> interested in, so you may have to set up a way to pause your script
    >>>> while you manually navigate, in the script's IE window, to the page of
    >>>> interest, and then have the script do its thing of getting the info of
    >>>> interest. A message box works fine for pausing the script, and when you
    >>>> continue the script by clicking OK on the message box, you will want to
    >>>> get the current IE document with something like Set oIEDoc =
    >>>> oIE.Document.
    >>>>
    >>>> One fairly quick way to learn about how to manipulate many of the
    >>>> features of the HTML DOM is to study a Microsoft HTA that can be used
    >>>> to build other HTAs, called HTA Helpomatic. All of its scripting is
    >>>> VBScript. HTAs use objects identical to those in HTML. Download it
    >>>> here:
    >>>> http://www.microsoft.com/downloads/d...3-ae7b9152e6d9
    >>>>
    >>>> The URL is long, so you may have to unwrap it.
    >>>> -Paul Randall
    >>>
    >>> In the web page, i found this:
    >>>
    >>> ...
    >>> var dhcp_data = new Array();
    >>> dhcp_data[0] = new Array(find_userfriendlyname(js_host_list,
    >>> '00:a0:aa:aa:1a:a0'), '192.168.1.18', '00:9a:da:aa:18:a0', null, null);
    >>> dhcp_data[1] = new Array(find_userfriendlyname(js_host_list,
    >>> '00:0e:ee:de:eb:e9'), '192.168.1.19', '00:aa:e4:d7:3b:a9', null, null);
    >>> ...
    >>>
    >>>
    >>> I try to read value in dhcp_data[1] with vbscript after load document
    >>> with
    >>>
    >>> Set ie = CreateObject("InternetExplorer.Application")
    >>> ie.navigate "http://www.example_page.com"
    >>> ...
    >>>
    >>>
    >>> it's possible ?
    >>
    >> Here is an HTA example using Evertjan's method:
    >>
    >> <html>
    >> <head>
    >> <title>JS Array to VBS array</title>
    >> <script language="vbscript">
    >> 'Putting this script here prepositions the window.
    >> 'Windowstate=Maximize would override this.
    >> Const wdDlg = 600, htDlg = 380 ' dialog size
    >> Const pxLeft = 100, pxTop = 100 ' positioning
    >> window.ResizeTo wdDlg,htDlg
    >> window.MoveTo pxLeft,pxTop
    >> </SCRIPT>
    >> <HTA:APPLICATION
    >> ID="Put your ID here"
    >> APPLICATIONNAME="Put your application name here"
    >> SCROLL="yes"
    >> SINGLEINSTANCE="no"
    >> WINDOWSTATE=""

    >>>
    >> </head>
    >>
    >> <SCRIPT Language="JScript">
    >> var a, b;
    >> a = new Array(0,1,2,3,4);
    >> b = a.join("-");
    >>
    >> </SCRIPT>
    >>
    >> <SCRIPT Language="VBScript">
    >> msgbox b
    >> myArray = split(b,"-")
    >> msgbox join(myarray, vbcrlf)
    >> </SCRIPT>
    >> <body>
    >> </body>
    >> </html>
    >
    > But you place the VBscript in web page! I want found the array value with
    > an external script.
    >
    > And the web page contain:
    >
    > var dhcp_data = new Array();
    > dhcp_data[0] = new Array(find_userfriendlyname(js_host_list,
    > '00:a0:aa:aa:1a:a0'), '192.168.1.18', '00:9a:da:aa:18:a0', null, null);
    > dhcp_data[1] = new Array(find_userfriendlyname(js_host_list,
    > '00:0e:ee:de:eb:e9'), '192.168.1.19', '00:aa:e4:d7:3b:a9', null, null);
    >
    > and i try to view value in dhcp_data[1] with the Vbscript launch from
    > windows, not in the web page.
    >
    > With another example with a internet web page:
    >
    >
    > <html>
    >
    > <script type='text/javascript'>var js_mbv_dhcpserverenabled = '1';var
    > js_mbv_ipinterfaceipaddress = '192.168.1.1';
    >
    > </script>
    >
    > <body>
    >
    > <form method="POST" action="bot">
    >
    > <p><input type="text" name="lacase" size="20" value="hello"><input
    > type="submit" value="Send" name="B1"><input type="reset" value="Cancel"
    > name="B2"></p>
    >
    > </form>
    >
    > </body>
    > </html>
    >
    >
    >
    > Now,i can view value "lacase" with a Windows VBScript
    >
    >
    > ' VBSCRIPT ------------------
    > Set objShell = WScript.CreateObject("WScript.Shell" )
    > Set ie = CreateObject("InternetExplorer.Application")
    > ie.navigate "d:\example.htm"
    > msgbox ie.document.All.tags("input").Item("lacase").Value
    > ' --------------------------------
    >
    > Now, how to retrieve value in "js_mbv_ipinterfaceipaddress" ?
    >
    > Regard.
    OK, now I think I understand your question. You know how to get properties
    of objects that are exposed by the DHTML DOM, and you are asking whether the
    DOM exposes the values of variables used within scripts.

    I'm thinking the answer is no, you can't get them. Hopefully someone will
    prove me wrong and post an example that does it.

    The docs: http://msdn.microsoft.com/en-us/libr...(v=VS.85).aspx
    don't mention variables used in the script. It does mention that you can
    get info about the script, including its namespace with something like this:
    msgbox ie.document.All.tags("script").item(0).text
    msgbox ie.document.All.tags("script").Item(0).uniqueID
    msgbox ie.document.All.tags("script").item(0).text
    msgbox ie.document.All.tags("script").Item(0).scopeName
    but I don't know how to get a list of the items in that namespace.

    -Paul Randall



      My System SpecsSystem Spec

Page 1 of 2 12 LastLast
get array from html problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fast copy method of sub array (=array range) possible? Thomas Lebrecht VB Script 6 19 Mar 2009
How to create array without quotes? $array = (a,b,c) BenConrad PowerShell 5 04 Feb 2009
Stupid Array Tricks: Initializing an Array to a Certain Size tojo2000 PowerShell 2 09 Sep 2008
working on html objects using HTML DOM, VBscript Rama VB Script 3 18 Aug 2008
how to assign values to array and how to create array via variable Frank PowerShell 1 13 Mar 2007