How do I pull this website data?

so use Power Query
Power Query:
// Table 0
let
    Source = Web.Page(Web.Contents("https://www.espn.com/nba/stats/team/_/view/opponent")),
    Data0 = Source{0}[Data],
    Index = Table.AddIndexColumn(Data0, "Index", 1, 1)
in
    Index

Power Query:
// Table 1
let
    Source = Web.Page(Web.Contents("https://www.espn.com/nba/stats/team/_/view/opponent")),
    Data1 = Source{1}[Data],
    Index = Table.AddIndexColumn(Data1, "Index", 1, 1)
in
    Index

Power Query:
// Merge1
let
    Source = Table.NestedJoin(#"Table 0",{"Index"},#"Table 1",{"Index"},"Table 1",JoinKind.LeftOuter),
    Expand = Table.ExpandTableColumn(Source, "Table 1", {"GP", "PTS", "FGM", "FGA", "FG%", "3PM", "3PA", "3P%", "FTM", "FTA", "FT%", "OR", "DR", "REB", "AST", "STL", "BLK", "TO", "PF"}, {"GP", "PTS", "FGM", "FGA", "FG%", "3PM", "3PA", "3P%", "FTM", "FTA", "FT%", "OR", "DR", "REB", "AST", "STL", "BLK", "TO", "PF"}),
    RC = Table.RemoveColumns(Expand,{"Index"}),
    Type = Table.TransformColumnTypes(RC,{{"RK", Int64.Type}, {"Team", type text}, {"GP", Int64.Type}, {"PTS", type number}, {"FGM", type number}, {"FGA", type number}, {"FG%", type number}, {"3PM", type number}, {"3PA", type number}, {"3P%", type number}, {"FTM", type number}, {"FTA", type number}, {"FT%", type number}, {"OR", type number}, {"DR", type number}, {"REB", type number}, {"AST", type number}, {"STL", type number}, {"BLK", type number}, {"TO", type number}, {"PF", type number}})
in
    Type
just in case

Got it, thank you!
 
Upvote 0

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
You are welcome & have a nice day
I have another question if you don't mind, if so just let me know and I will post another thread.

I decided to also add an entire excel database tab of every current NBA player that has a column for their respective team, and then columns for stats. Is there a formula I can input that will search that database tab for a specific team, and then return the player name beside that team to that cell, and then do the same thing for the cell under it but the next players name, and so on and so forth until every player that plays for that team has had their name returned?
 
Upvote 0
This is different question so post new thread
(with representative data source and expected result and detailed description)
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,370
Members
449,080
Latest member
Armadillos

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