小编And*_*son的帖子

如何使用R中的readHTMLTable读取已注释掉的HTML表

在过去,我已经能够在R中使用readHTMLTable来提取一些足球统计数据.当今年再次尝试这样做时,表格没有显示,即使它们在网页上可见.以下是一个示例:http://www.pro-football-reference.com/boxscores/201609080den.htm

当我查看页面的源代码时,表格都被注释掉了(我怀疑是为什么readHTMLTable没有找到它们).

示例:在源代码中搜索"team_stats"...

    <!--  
    <div class="table_outer_container">
    <div class="overthrow table_container" id="div_team_stats">
    <table class="stats_table" id="team_stats" data-cols-to-  freeze=1><caption>Team Stats Table</caption>
Run Code Online (Sandbox Code Playgroud)

问题:

如何在源中注释掉表,并在浏览器中显示?

有没有办法使用readHTMLTable(或其他一些方法)读取注释掉的表?

html r html-parsing

2
推荐指数
1
解决办法
463
查看次数

标签 统计

html ×1

html-parsing ×1

r ×1