-
Notifications
You must be signed in to change notification settings - Fork 342
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
html_table() error #204
Comments
This error is the result of assuming that the html is formed properly and that a row span does not go beyond the end of the table.
If you add a check to see if you're at the end of the table, it works for (k in seq_len(rowspan - 1)) {
#ADD the following line it works just fine
if (j+k > nrow(out)) break;
l <- utils::head(out[j+k, ], i-1)
r <- utils::tail(out[j+k, ], maxp-i+1)
out[j + k, ] <- utils::head(c(l, out[j, i], r), maxp)
} |
Hi, I have the same problem, but I couldnt fix it with the help above. library('rvest') url <- 'http://www2.bmf.com.br/pages/portal/bmfbovespa/lumis/lum-taxas-referenciais-bmf-ptBR.asp' #Le o codigo HTML da url indicada Error in out[j + k, ] : subscript out of bounds Can you please help me? |
create your own version of html_table.xml_node and put in: this line: for (k in seq_len(rowspan - 1)) { |
I am sorry, I need more details. What is this rowspan? Can you please send me the whole code that you have tested and worked? Thank you very much |
I'm somewhat new to scraping with R, but I'm getting an error message that I can't make sense of. A commenter on stackoverflow said that html_table() isn't handling the colspan logic correctly and suggested I file a bug report.
My code:
To which I get the response:
The text was updated successfully, but these errors were encountered: