带有rvest的r scrape表(iframe问题?)
我想使用rvest在网站上刮擦一张桌子。我可以在页面上刮擦几个元素,但该表中的表也不是元素。我怀疑这与表是“ iframe”有关的事情,但是到目前为止,我还没有找到 +刮擦源HTML。
非常感谢! 阿德里安
# set up
library(rvest)
library(tidyverse)
# scraping
url <- "https://u.gg/lol/top-lane-tier-list?rank=iron"
main_page <- read_html(url)
patch <- html_node(main_page, "#stats-tables-container-ID > div.title-header > h1 > div") %>% html_text()
rank <- html_node(main_page, ".rank-option") %>% html_text()
table <- html_table(main_page, ".#stats-tables-container-ID > div.stats-tables__content-container > div > div > div > div.content-section.ReactTable.ugg-table-2.tier-list")
I want to scrape a table on a website using rvest. I can scrape several elements on the page but not the table nor elements within this table. I suspect this has something to do with the table being an "iframe" but so far I failed to find + scrape the source html.
Many thanks in advance!
Adrien
# set up
library(rvest)
library(tidyverse)
# scraping
url <- "https://u.gg/lol/top-lane-tier-list?rank=iron"
main_page <- read_html(url)
patch <- html_node(main_page, "#stats-tables-container-ID > div.title-header > h1 > div") %>% html_text()
rank <- html_node(main_page, ".rank-option") %>% html_text()
table <- html_table(main_page, ".#stats-tables-container-ID > div.stats-tables__content-container > div > div > div > div.content-section.ReactTable.ugg-table-2.tier-list")
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我能够提取桌子,但没有rvest。我使用以下代码:
我获得了以下结果:
I was able to extract the table but not with rvest. I used the following code :
I obtained the following result :