I am looking VBScript example that does the following:
1. opens webpage in internet explorer.
2. For webpage with a table diplay, reads all rows and columns 0 & 1.
3. Displays a msgbox for each item in column 0 along with row #. (msgbox = cellvalue & " found on row " & row)
Thanks for your help!
BennyBB
Here is what I have so far for URL emetalshop.websites.com
1. opens webpage in internet explorer.
2. For webpage with a table diplay, reads all rows and columns 0 & 1.
3. Displays a msgbox for each item in column 0 along with row #. (msgbox = cellvalue & " found on row " & row)
Thanks for your help!
BennyBB
Here is what I have so far for URL emetalshop.websites.com
Code:
' Visual Basic Script (VBS)
'
'
'
Option Explicit
' Declaration of variables
Dim ie
' Declaration of subroutines
' Sub WaitForLoad waits for webpage to finish loading
' before proceeding with next line of code
Sub WaitForLoad
Do while ie.Busy
wscript.sleep 200
Loop
End Sub
' Open windows Internet explorer and surf to website
set ie = CreateObject("InternetExplorer.Application")
ie.Navigate "emetalshop.webstarts.com"
ie.Toolbar=0
ie.StatusBar=0
ie.Height=560
ie.Width=1000
ie.Top=0
ie.Left=0
ie.Resizable=0
Call WaitForLoad
ie.Visible = true
' Add code below to display in a msgbox the contents of each cell in column 0 (first column) should loop for each row.
'
dim i
dim table
dim CellContent0()
dim CellContent1()
Set table = document.getelementbyid("table")
redim CellContent0(table.rows.length-1)
redim CellContent1(table.rows.length-1)
CellContent0(i) = table.rows(i).cells(0).innerText
CellContent1(i) = table.rows(i).cells(1).innerText
for i = 0 to table.rows.lenth-1
cellcontent0(i) = table.rows(i).cells(0).innertext
cellcontent1(i) = table.rows(i).cells(1).innertext
msgbox cellcontent0(i) & " " & cellcontent1(i)
next