【问题标题】:Scraping from Aria Table Column Using Rvest使用 Rvest 从 Aria 表列中抓取
【发布时间】:2017-03-07 10:29:28
【问题描述】:

小问题,我不认为这是基于谷歌搜索的复制。

我正在尝试从一组表中抓取数据,例如“名字”http://www.votewatch.eu/en/term8-thailand-notably-the-case-of-andy-hall-joint-motion-for-resolution-paragraph-11-amendment-1.html

我正在尝试使用

library(rvest)
library(magrittr)
url <- "http://www.votewatch.eu/en/term8-thailand-notably-the-case-of-andy-hall-joint-motion-for-resolution-paragraph-11-amendment-1.html"
read <- read_html(url)
nodes <- read %>% html_nodes("td.sorting_1 > a") #based on copy/paste CSS selector

但是得到一个长度为 0 的节点,我无法从中提取任何东西。我也尝试使用选择器小工具,但仍然无法从桌面上取下任何东西。

有什么想法吗?谢谢,

【问题讨论】:

    标签: r screen-scraping rvest


    【解决方案1】:

    因为页面需要登录...

    您需要先进行身份验证...查看Rselenium 这将更难抓取。

    【讨论】:

    • 在浏览器上登录后,我仍然可以(例如)从上面的表格中抓取,例如日期:url &lt;- "http://www.votewatch.eu/en/term8-2026-un-climate-change-conference-in-marrakesh-morocco-cop22-motion-for-resolution-vote-resolution.html" read &lt;- read_html(url) nodes &lt;- read %&gt;% html_nodes("body &gt; div.normal_page &gt; div.content_all_page &gt; div.container.content &gt; div &gt; div.width_60_percent.vote_facts.floatleft &gt; div &gt; div.vote_all_info &gt; div:nth-child(5)")至于 selenium,我现在只有一台旧的工作笔记本电脑,所以不能给它特权
    • RSelenium 不需要管理员权限,并且根据我的经验,它不是资源密集型的。 This tutorial 很好地介绍了 rvestRSelenium
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-03
    • 2022-01-15
    相关资源
    最近更新 更多