weberxu 发表于 2015-7-27 14:45 
谢谢你!原因是什么?我把最外层的for循环拿掉之后,里边的是能正确运行的并且得到正确的结果,X也并不是 ...
x <- grep('<div class=\"block\"',tmp1)
可能返回的结果是空集,就是没有找到匹配的项目
grep(value = FALSE) returns a vector of the indices of the elements of x that yielded a match (or not, for invert = TRUE. This will be an integer vector unless the input is a long vector, when it will be a double vector.