陈革007

2020-05-09   阅读量: 1333

Power BI 数据分析师

Power BI : PQ 爬取数据(二) ---Web.BrowserContents (30个队伍的数据都可以爬取到)

扫码加入数据分析学习群

上一帖使用web page wen content, 这个帖子用Web.BrowserContents

唯一区别!!! 所有队伍的内容都可以爬取到,没有null, 这一点比web page web content好

在上一帖中,重复的步骤就直接跳过:

自定义公式 写: "

let

源 = Web.BrowserContents("https://china.nba.com/teams/stats/#!/"&[英文]),

#"从 Html 中提取的表" = Html.Table(源, {{"Column1", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(1)"}, {"Column2", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(2)"}, {"Column3", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(3)"}, {"Column4", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(4)"}, {"Column5", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(5)"}, {"Column6", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(6)"}, {"Column7", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(7)"}, {"Column8", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(8)"}, {"Column9", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(9)"}, {"Column10", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(10)"}, {"Column11", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(11)"}, {"Column12", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(12)"}, {"Column13", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(13)"}, {"Column14", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(14)"}, {"Column15", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(15)"}, {"Column16", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(16)"}, {"Column17", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(17)"}, {"Column18", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(18)"}, {"Column19", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(19)"}, {"Column20", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(20)"}, {"Column21", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(21)"}, {"Column22", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(22)"}, {"Column23", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(23)"}, {"Column24", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(24)"}, {"Column25", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(25)"}, {"Column26", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(26)"}, {"Column27", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(27)"}, {"Column28", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(28)"}, {"Column29", "DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR > :nth-child(29)"}}, [RowSelector="DIV.ng-scope:nth-child(1) > NBA-STAT-TABLE.team-stats__table.ng-isolate-scope > DIV.nba-stat-table > DIV.nba-stat-table__overflow > TABLE > * > TR"]),

提升的标题 = Table.PromoteHeaders(#"从 Html 中提取的表", [PromoteAllScalars=true])

in

提升的标题

"

后面的 步骤和上一帖内容一样, 筛选 展开结果等等

添加CDA认证专家【维克多阿涛】,微信号:【cdashijiazhuang】,提供数据分析指导及CDA考试秘籍。已助千人通过CDA数字化人才认证。欢迎交流,共同成长!
52.3137 7 3 关注作者 收藏

评论(0)


暂无数据

推荐课程

推荐帖子