View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Rik Rik is offline
external usenet poster
 
Posts: 16
Default Pick data from web page (no query)

I guess your last post was not relevant because it seems there's only 1 page,
each different page has its own URL. I found out with code below, i tested
either with homepage or with the page that i try to work with.

My conclusion is : the data that i want to transfer into excel are hidden
(you can't refer to them by trheir ID ??). I'm afraid there's no solution.
Hope that i'm wrong ???


===============================
Sub pages()


Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True

'test with either next line
URL =
"https://www.binck.com/gekko/default.aspx?Redir=/gekko/common/researchennieuws/fondsdetails/overzicht.aspx?binc=1068754"

'or next line
'URL = "https://www.binck.nl/gekko/common/inloggen.aspx"

'get web page
IE.Navigate2 URL
Do While IE.readyState < 4
DoEvents
Loop
Set last = IE.document.all
teller = 0
RowCount = 1
For Each itm In IE.document.all
If itm.ID < "" Then
With ActiveSheet

.Range("A" & RowCount) = itm.ID
RowCount = RowCount + 1
End With
Else
'do nothing
End If
teller = teller + 1
If teller = 5 Then
GoTo line1
Else
End If
Next itm
line1:
Range("K1") = 1


If IE.document.getelementsbytagname("B").Length < 0 Then
Set PageNumbers = _
IE.document.getelementsbytagname("B") _
.Item(0).nextsibling

If Not PageNumbers Is Nothing Then
Page = Val(PageNumbers.innertext) - 1
Range("d1") = Page
End If
Else
Set PageNumbers = Nothing
Range("d2") = Page
End If


End Sub
================================================== ==