首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Web-Scraping -多个带R的页面

Web-Scraping -多个带R的页面
EN

Stack Overflow用户
提问于 2017-06-21 16:56:47
回答 0查看 1.2K关注 0票数 1

我需要从网上刮html表使用R。有一个1000行的每页一个表,总共有316页。第一个url的链接在这里:“http://sumodb.sumogames.de/Query.aspx?show_form=0&columns=6&rowcount=5&showheya=on&showshusshin=on&showbirthdate=on&showhatsu=on&showintai=on&showheight=on&showweight=on&showhighest=on

然后我认为只有偏移量在其他urls上递增(1000,2000,3000...,316000

这是我到目前为止在一个页面上工作的代码:

代码语言:javascript
运行
复制
    library(XML)
    library(rvest)

url <- read_html("http://sumodb.sumogames.de/Query.aspx?show_form=0&columns=6&rowcount=5&showheya=on&showshusshin=on&showbirthdate=on&showhatsu=on&showintai=on&showheight=on&showweight=on&showhighest=on")
     
    table <- url %>%
         html_nodes(".record") %>%
         html_table(fill = TRUE)
     table

大表的每个页面上的css选择器是".record“。

最终目标是将整个表放在一个CSV文件中。

EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44671351

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档