【问题标题】:How can I count the number of tables in an HTML page?如何计算 HTML 页面中的表格数量?
【发布时间】:2013-11-11 10:15:21
【问题描述】:

我相信包裹XML 有一个解决方案。但是,哪个函数是正确的呢?

例如: http://en.wikipedia.org/wiki/List_of_deaths_on_eight-thousanders

【问题讨论】:

    标签: html r web-scraping html-table


    【解决方案1】:

    我想有 20 张桌子。使用readHTMLTable 可以提取所有表:

    url <- "http://en.wikipedia.org/wiki/List_of_deaths_on_eight-thousanders"
    
    library(XML)
    ll <- readHTMLTable(url)
    length(ll)
    [1] 20
    

    【讨论】:

      猜你喜欢
      • 2012-07-23
      • 2023-04-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多