stream $ next_ident()中的错误:预期的身份,得到了<DELIM'。在2>

时间:2019-12-30 11:34:54

标签: html string parsing web-scraping tibble

我正在尝试为我的学校项目解析站点,但是当我尝试将数据合并到表中时出了点问题。您对下面的问题有任何想法吗?您知道网络剪贴的任何好教程吗?

提前谢谢!

scrape_write_table <- function(url,PopCornNews){

    list_of_pages <- str_c(url, '?page=', 1:100)
      list_of_pages %>% 
        map(get_data_from_url, PopCornNews) %>%  
        bind_rows() %>%                         
        write_tsv(str_c(PopCornNews,'.tsv'))     
    }
 scrape_write_table(url, 'PopCornNews')
    gdr_tbl <- read_tsv('PopCornNews.tsv')
    tail(gdr_tbl, 5)```

Output:
> scrape_write_table <- function(url,PopCornNews){
+ 
+     list_of_pages <- str_c(url, '?page=', 1:100)
+       list_of_pages %>% 
+         map(get_data_from_url, PopCornNews) %>%  
+         bind_rows() %>%                         
+         write_tsv(str_c(PopCornNews,'.tsv'))     
+     }
>  scrape_write_table(url, 'PopCornNews')
**Error in stream$next_ident() : Expected ident, got <DELIM '.' at 2>**

0 个答案:

没有答案