HockeyReference.com has a table on each player's page called NHL Possession Metrics, and that table has selectable tabs for "All", "Even Strength", "Power Play" and other situations. The "All" table is the displayed table, but I want to scrape information from the hidden "Power Play Table." I can't seem to find a way to get any data from the hidden sub-table "Power Play" though. Here is the link to a sample player's page: https://www.hockey-reference.com/players/a/abdelju01.html
What I'm trying to do is search by XPath to find the season entry for each row in the Power Play table, and then find the TOI column entry in the row, and cycle each row until there are no more season entries. I'm not getting any values though, and sval and tval in my code keep returning empty. Any help would be greatly appreciated.
The Code I've tried is:
Dim chrm As Selenium.ChromeDriver
Dim Hitem As Selenium.WebElement, Citem As Selenium.WebElement
Dim xpval As String, sval As String, tval As String
Dim rnum As Integer
rnum = 1
Do
xpval = "/html/body/div[4]/div[5]/div[9]/div[9]/div[3]/table/tbody/tr[" & Trim(Str(rnum)) & "]/th"
Set Hitem = chrm.FindElementByXPath(xpval, timeout:=0)
sval = Hitem.Text
xpval = "/html/body/div[4]/div[5]/div[9]/div[9]/div[3]/table/tbody/tr[" & Trim(Str(rnum)) & "]/td[5]"
Set Citem = chrm.FindElementByXPath(xpval, timeout:=0)
tval = Citem.Text
If tval <> "" Then
...
End If
rnum = rnum + 1
Loop Until IsNumeric(Left(sval, 4)) = False