Cannot pull table from different tabs within the same webpage.

mj sachoo

New Member
Joined
Nov 18, 2020
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am trying to obtain the data table from website. However, I can only extract the data from the 'Price' tab.

1605753640023.png


I cannot obtain the tables under the 'Performance', 'Technical and 'Fundamental Tabs.

I get the following error when trying to click the other tabs:

1605753837311.png


I do not know how to get these tables from other tabs.

Last hope is this website as I have not got anything from other forums or websites.

Please advise.

Thanks
 
Try the following maceo:
VBA Code:
Sub Sportrdr()
Dim TbColl As Object, myTab, BColl As Object, pCount As Long
Dim I As Long, J As Long, mySplit, myTim As Single
Dim WPage As New WebDriver
'
Sheets("Foglio3").Select            '<<< The sheet for the results
'
WPage.Start "Chrome", "https://s5.sir.sportradar.com/bet9javirtuals/en/1/season/2477086/fixtures/full"
WPage.Get "/"
'
myTim = Timer
Range("A:E").ClearContents
Range("C:D").NumberFormat = "@"
'
Do
    WPage.Wait 700
    Set BColl = WPage.FindElementsByTag("Button")
    If BColl.Count > 0 And BColl(BColl.Count).Text = "Show more" Then
        BColl(BColl.Count).Click
        WPage.Wait 200
    Else
        Exit Do
    End If
Loop
Set TbColl = WPage.FindElementsByTag("table")
myTab = TbColl(1).AsTable.Data
For I = 1 To UBound(myTab)
    myTab(I, 3) = Left(myTab(I, 3), Len(myTab(I, 3)) / 2)
    myTab(I, 4) = Left(myTab(I, 4), Len(myTab(I, 4)) / 2)
Next I
Range("A1").Resize(UBound(myTab), UBound(myTab, 2)).Value = myTab
End Sub

Thank You so much

I encountered an error attached picture is the error

1664166474714.png
 
Upvote 0

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
To avoid that error you need to set a reference to the "Selenium type library":
-from vba windows...
-Menu /Tools /Reference; scroll the Reference list, select and check "Selenium Type Library"
-press Ok

Retry...
 
Upvote 0
To avoid that error you need to set a reference to the "Selenium type library":
-from vba windows...
-Menu /Tools /Reference; scroll the Reference list, select and check "Selenium Type Library"
-press Ok

Retry...
It brought this error sir after effecting the correction

1664180113945.png
 
Upvote 0
And of course you don't have a sheet named "Foglio3"; so either modify the instruction with YOUR sheet name or name one of your sheets "Foglio3"
 
Upvote 0
And of course you don't have a sheet named "Foglio3"; so either modify the instruction with YOUR sheet name or name one of your sheets "Foglio3"
wow I was about to update you that I just discovered from the code that the sheet is names foglio3. then I saw your response.

so when i named it to Foglio is says my chome version and driver are different. so I am about to get a new version of chrome driver.

1664180855553.png
 
Upvote 0
You have to replace the old chromedriver.exe with a new one suitable for your chrome version.
Check here:
 
Upvote 0
You have to replace the old chromedriver.exe with a new one suitable for your chrome version.
Check here:
Thank you so much sir.

It worksssssssss
 
Upvote 0
Hello Anthony

I tried to but the code to use tonight.

sometimes it loads and sometimes it says "index was outside the bonds of the array".

then It highlighted the code when i clicked on debug.

1664484143834.png



1664483773157.png
 
Upvote 0
Hello Anthony

I tried to but the code to use tonight.

sometimes it loads and sometimes it says "index was outside the bonds of the array".

then It highlighted the code when i clicked on debug.

View attachment 75094


View attachment 75092
Hello Anthony

I tried to but the code to use tonight.

sometimes it loads and sometimes it says "index was outside the bonds of the array".

then It highlighted the code when i clicked on debug.

View attachment 75094


View attachment 75092
In addition, I need to let you know the following:

A season is two hours plus
I do change the number in the link to the current season current number
The link we have been using is an already played season which has had all it results for all the matches in the season
I need only an ongoing season data to make my prediction which all the result have not been filled except for the ones that has played.
The yet to be played games scores are denoted with an hyphen "-" attached picture. so I am not sure if that was the reason for the problem


thanks

1664485475807.png
 
Upvote 0

Forum statistics

Threads
1,223,996
Messages
6,175,851
Members
452,675
Latest member
duongtruc1610

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top