Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RStudio crashes when read_html()ing an empty html #150

Closed
tomasbarcellos opened this issue Nov 22, 2016 · 2 comments
Closed

RStudio crashes when read_html()ing an empty html #150

tomasbarcellos opened this issue Nov 22, 2016 · 2 comments

Comments

@tomasbarcellos
Copy link

I have first send this issue as a rvest issue (#179), but I was convinced that it should acctualy be at this project.

RStudio crashes when trying to read an empty html (the download failed and I was not aware). It is similar to this readr issue: #378. As you can see below, the error is not in xml2::read_html(), it produces the proper output:

> library(rvest)
> tf <- tempfile()
> file.create(tf)
[1] TRUE
> html_error <- read_html(tf)
> str(html_error)
List of 2
 $ node:<externalptr> 
 $ doc :<externalptr> 
 - attr(*, "class")= chr [1:2] "xml_document" "xml_node"

If I then enter html_error %>% html_nodes('h1') %>% html_text() it crashes. No warning nor error message is given; it would be handy.

Here is my sessionInfo():

> sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=Portuguese_Brazil.1252  LC_CTYPE=Portuguese_Brazil.1252   
[3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C                      
[5] LC_TIME=Portuguese_Brazil.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] rvest_0.3.2 xml2_1.0.0 

loaded via a namespace (and not attached):
[1] httr_1.2.1     magrittr_1.5   R6_2.2.0       parallel_3.3.2 tools_3.3.2   
[6] NLP_0.1-9      Rcpp_0.12.7    slam_0.1-38    tm_0.6-2      
@isaranja
Copy link

R session is aborted when I am trying to do read_html(). I think it is same issue where my URL return empty html. The URL that I am trying to scrape is "http://syndication.traffichaus.com/"

@jimhester
Copy link
Member

Fixed by #126

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants