【发布时间】:2018-03-20 20:24:45
【问题描述】:
我正在尝试从该页面中获取博彩公司赔率:
https://www.interwetten.com/en/sportsbook/top-leagues?topLinkId=1
所以到目前为止我写了以下代码
interwetten <- read_html("https://www.interwetten.com/en/sportsbook/top-leagues?topLinkId=1")
bundesliga <- html_nodes(interwetten, xpath = '//*[@id="TBL_Content_1019"]')
bundesliga_teams <- html_nodes(bundesliga, "span")
现在我得到的输出是:
[1] <span id="ctl00_cphMain_UCOffer_LeagueList_rptLeague_ctl00_ucBettingContainer_lblClose" clas ...
[2] <span itemscope="itemscope" itemprop="location" itemtype="http://schema.org/Place"><meta ite ...
[3] <span itemprop="name">VfB Stuttgart</span>
[4] <span>X</span>
现在我想提取 every <span itemprop="name"></span> 中的团队名称,但我不知道如何提取它。我尝试使用节点或属性,但没有成功。
【问题讨论】:
标签: r web-scraping html-parsing rvest