【发布时间】:2020-04-27 03:15:30
【问题描述】:
我目前正在尝试从以下链接中抓取播放条目: https://www.basket.fi/basketball-finland/competitions/game/?game_id=4677793&season_id=110531&league_id=4
我使用 SelectorGadget 来确定 CSS 选择器并最终得到 '//td'。但是,当我尝试使用它来抓取数据时,html_nodes() 返回一个空列表,因此以下代码返回错误。
library("rvest")
url <- "https://www.basket.fi/basketball-finland/competitions/game/?game_id=4677793&season_id=110531&league_id=4"
play_by_play <- url %>%
read_html %>%
html_node(xpath='//td') %>%
html_table()
play_by_play
有人知道如何解决这个问题吗?
提前谢谢你!
【问题讨论】:
标签: r web-scraping css-selectors rvest