Based the site:
https://www.oklotto.it/ambi-frequenti.php
how to get all value from table in square red?
tks
idea to ghet value from web table
-
- PlatinumLounger
- Posts: 4641
- Joined: 26 Apr 2010, 17:36
idea to ghet value from web table
You do not have the required permissions to view the files attached to this post.
-
- 5StarLounger
- Posts: 775
- Joined: 27 Jun 2021, 10:46
Re: idea to ghet value from web table
Doers not the response in your https://eileenslounge.com/viewtopic.php ... 4a798de8f7 give you a hint as to how you might do this?
One problem you will encounter is that this is a dynamic page, and so using MSXML2 library (which I suspect from your previous posts you are) won't really work, as it doesn't capture e.g tables injected by javascript.
So you'll need to use the ie library.
One problem you will encounter is that this is a dynamic page, and so using MSXML2 library (which I suspect from your previous posts you are) won't really work, as it doesn't capture e.g tables injected by javascript.
So you'll need to use the ie library.
-
- PlatinumLounger
- Posts: 4641
- Joined: 26 Apr 2010, 17:36
Re: idea to ghet value from web table
i bro... infact dont work with MSXML2SpeakEasy wrote: ↑14 Apr 2025, 11:29Doers not the response in your https://eileenslounge.com/viewtopic.php ... 4a798de8f7 give you a hint as to how you might do this?
One problem you will encounter is that this is a dynamic page, and so using MSXML2 library (which I suspect from your previous posts you are) won't really work, as it doesn't capture e.g tables injected by javascript.
So you'll need to use the ie library.
Have an idea with IE object?
Tks.
-
- 5StarLounger
- Posts: 775
- Joined: 27 Jun 2021, 10:46
Re: idea to ghet value from web table
Code: Select all
Sub sppon2ie()
Dim ie As Object
Dim html As Object
Dim mytable As Object
Dim rowIndex As Long
Dim colIndex As Long
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = False
ie.Silent = True
ie.navigate "https://www.oklotto.it/ambi-frequenti.php"
Do While ie.Busy Or ie.readyState <> 4
DoEvents
Loop
Set html = ie.document
' Now tables added via JavaScript are there
Set mytable = html.getElementsByTagName("table")(3)
For rowIndex = 0 To mytable.Rows.Length - 1
For colIndex = 0 To mytable.Rows(rowIndex).Cells.Length - 1
Debug.Print mytable.Rows(rowIndex).Cells(colIndex).innerText
Next
Next
' Clean up
Set html = Nothing
ie.Quit
Set ie = Nothing
End Sub
-
- PlatinumLounger
- Posts: 4641
- Joined: 26 Apr 2010, 17:36
Re: idea to ghet value from web table
GREAT CODE BRO!SpeakEasy wrote: ↑14 Apr 2025, 16:58Code: Select all
Sub sppon2ie() Dim ie As Object Dim html As Object Dim mytable As Object Dim rowIndex As Long Dim colIndex As Long Set ie = CreateObject("InternetExplorer.Application") ie.Visible = False ie.Silent = True ie.navigate "https://www.oklotto.it/ambi-frequenti.php" Do While ie.Busy Or ie.readyState <> 4 DoEvents Loop Set html = ie.document ' Now tables added via JavaScript are there Set mytable = html.getElementsByTagName("table")(3) For rowIndex = 0 To mytable.Rows.Length - 1 For colIndex = 0 To mytable.Rows(rowIndex).Cells.Length - 1 Debug.Print mytable.Rows(rowIndex).Cells(colIndex).innerText Next Next ' Clean up Set html = Nothing ie.Quit Set ie = Nothing End Sub
But based BARI, for example, i can get one to one the horizontal cells?
-
- 5StarLounger
- Posts: 775
- Joined: 27 Jun 2021, 10:46
Re: idea to ghet value from web table
My code is an illustration of how to retrieve specific cells of an HTML table. You should now have all the information necessary to complete your task yourself.