【发布时间】:2016-01-31 13:39:15
【问题描述】:
我想知道rvest 包中是否有这种行为。当rvest 看到< 字符时,它会停止读取HTML。
library(rvest)
read_html("<html><title>under 30 years = < 30 years <title></html>")
打印:
[1] <head>\n <title>under 30 = </title>\n</head>
如果这是故意的,是否有解决方法?
【问题讨论】:
-
解决方法是停止使用无效的 HTML。
-
您并不总是能够选择您正在阅读的 HTML。
-
当然,这就是为什么 rvest 不会在错误的 sn-p 上失败,但会产生最佳猜测。浏览器也是如此。
标签: html r html-parsing rvest