简体   繁体   English

用RVest抓取HTML-获取HTTP错误416

[英]Scraping html with rvest - getting http error 416

I am trying to scrape the HTML of this page using R (package rvest), but am getting "client error 416: Requested Range Not Satisfiable" 我正在尝试使用R(软件包rvest)抓取此页面的HTML,但是收到“客户端错误416:请求的范围不满意”

After a long search, I can't seem to find a solution. 经过长时间的搜索,我似乎找不到解决方案。 It throws the error when trying to use rvest's html function, which parses an HTML page: 尝试使用rvest的html函数解析HTML页面时,它将引发错误:

url <- "http://shop.tcgplayer.com/magic/onslaught/polluted-delta"
html(url)

I am using R version 3.2.0. 我正在使用R版本3.2.0。

Any help would be appreciated! 任何帮助,将不胜感激!

You are pretty close, just keep extracting from url with the now updated read_html : 您已经很接近了,只需使用最新更新的read_html继续从url提取read_html

> read_html(url) %>%
+   html_nodes("table") %>%
+   html_text() %>%
+   .[[1]]
[1] "\r\n                                Rarity:\r\n                                                R\r\n                                                Card Type:\r\n                                                Land \r\n                                                Description:\r\n                                                Tap, Pay 1 life, Sacrifice Polluted Delta:  Search your library for an island or swamp card   and put it into play. Then shuffle your library.\r\n\r\n                                \r\n                        "

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM