count element in table html

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Feb 2008
Posts: 20
Reputation: sal21 is an unknown quantity at this point 
Solved Threads: 0
sal21 sal21 is offline Offline
Newbie Poster

count element in table html

 
0
  #1
Mar 5th, 2009
http://www.x-rates.com/cgi-bin/cgica...lue=1&base=EUR
Based the link how to count element in table of this page?

note: is the table where are all currency values

tks.

in vba please
Last edited by sal21; Mar 5th, 2009 at 8:41 am.
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 832
Reputation: vb5prgrmr will become famous soon enough vb5prgrmr will become famous soon enough 
Solved Threads: 152
vb5prgrmr vb5prgrmr is offline Offline
Practically a Posting Shark

Re: count element in table html

 
0
  #2
Mar 5th, 2009
Originally Posted by sal21 View Post
http://www.x-rates.com/cgi-bin/cgica...lue=1&base=EUR
Based the link how to count element in table of this page?

note: is the table where are all currency values

tks.

in vba please
What technology are you using to view/download the document?
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 20
Reputation: sal21 is an unknown quantity at this point 
Solved Threads: 0
sal21 sal21 is offline Offline
Newbie Poster

Re: count element in table html

 
0
  #3
Mar 5th, 2009
Originally Posted by vb5prgrmr View Post
What technology are you using to view/download the document?
vba for excel.
piece of my code to connect:

Set oIE = CreateObject("InternetExplorer.Application")

With oIE

'For lngRow = 1 To lngMaxRow

' PAGINA = 1
' ABI = Empty
' ABI = WS.Range("B" & lngRow)

'If WS.Range("C" & lngRow) = Empty Then

URL = "http://www.x-rates.com/cgi-bin/cgicalc.cgi?value=1&base=EUR"
Debug.Print URL
.Visible = True
.Navigate (URL)

Do While .Busy
DoEvents
Loop

Do While .ReadyState <> 4
DoEvents
Loop

.....

ecc...
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 832
Reputation: vb5prgrmr will become famous soon enough vb5prgrmr will become famous soon enough 
Solved Threads: 152
vb5prgrmr vb5prgrmr is offline Offline
Practically a Posting Shark

Re: count element in table html

 
0
  #4
Mar 5th, 2009
Okay, at first I thought this might be tough to do since it is a spawned application, but... It was easier than I thought. Add these variables at the top.
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Dim C, I As Integer
and then after your readystate check add this
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. For Each C In .Document.links
  2. I = I + 1
  3. Next C
  4. MsgBox I

Now, as you can see, "C" is a varient and "I" is used for counting the links. Also, I tried .Document.Links.Count but that is not supported so you have to enumerate through them to get the count.

Good Luck
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC