使用rstudio中的XPath访问某些类别的问题
你好吗?我正在尝试访问一个特定的运动底网,我想获得正在播放的足球比赛的名称,但是当我尝试时,我只能访问所有活动名称,而我不知道为什么。我正在使用此代码:
library(rvest)
library(tidyverse)
library(xml2)
html="https://www.supermatch.com.uy/live_recargar_menu/"
a=rvest::read_html(html)
b2= a %>% html_node("body") %>% html_node(xpath="//li[@class='sport code_sport-1']") %>%
html_nodes(xpath="//span[@class='titulo']") %>% html_text()
如您所见,此代码获取正在播放的所有事件的名称。
how are you? I am trying to access to a particular sportbetting web, i want to get the names of the football matches that are being played, but when i try i only get access to all the event names and i do not know why. I am using this code:
library(rvest)
library(tidyverse)
library(xml2)
html="https://www.supermatch.com.uy/live_recargar_menu/"
a=rvest::read_html(html)
b2= a %>% html_node("body") %>% html_node(xpath="//li[@class='sport code_sport-1']") %>%
html_nodes(xpath="//span[@class='titulo']") %>% html_text()
As you can see, this code gets the name for all the events that are being played.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)