sel <- '<body>
<select name="b" id="a">
<option value="x">x</option>
<option>y</option>
</select>
</body>'
read_html(sel) %>% html_node('select') %>% rvest:::parse_select()
gives
Error in vapply(x, .subset2, i, FUN.VALUE = type) :
values must be length 1,
but FUN(X[[1]]) result is length 0
But
sel <- '<body>
<select name="b" id="a">
<option value="x">x</option>
<option value="y">y</option>
</select>
</body>'
read_html(sel) %>% html_node('select') %>% rvest:::parse_select()
works fine:
$name
[1] "b"
$value
character(0)
$options
x y
"x" "y"
attr(,"class")
[1] "select"
value attribute is not mandatory, is it?
gives
But
works fine:
valueattribute is not mandatory, is it?