problem with scraping a messy html website

Viewed 29

My problem may be dumb, but i must do other work right now so i beg for your help.

I have the following code, that makes a list of multiple pages of the same category in a website (in this case, an economy newspaper). For the list, I used the function paste0 (it's working fine with other websites I'm using). The problem is that all of the pages of the website end with ".html" to run, and as soon as I add that requeriment to the coding, all of the individual links in the link turn into one giant mess. (See below)

    urls <- paste0(DF_ntrp, "all/taxport_1___", seq(npages), collapse = ".html")
tbl_dfntrp <- do.call(rbind, lapply(urls, scrape_change_page))

##Noticias del país en DF Chile, 12 páginas hacia atrás desde ejecución del código###

print(tbl_dfntrp)

> urls
[1] "https://www.df.cl/noticias/site/tax/port/all/taxport_1___1.htmlhttps://www.df.cl/noticias/site/tax/port/all/taxport_1___2.htmlhttps://www.df.cl/noticias/site/tax/port/all/taxport_1___3.htmlhttps://www.df.cl/noticias/site/tax/port/all/taxport_1___4.htmlhttps://www.df.cl/noticias/site/tax/port/all/taxport_1___5.htmlhttps://www.df.cl/noticias/site/tax/port/all/taxport_1___6.htmlhttps://www.df.cl/noticias/site/tax/port/all/taxport_1___7.htmlhttps://www.df.cl/noticias/site/tax/port/all/taxport_1___8.htmlhttps://www.df.cl/noticias/site/tax/port/all/taxport_1___9.htmlhttps://www.df.cl/noticias/site/tax/port/all/taxport_1___10.htmlhttps://www.df.cl/noticias/site/tax/port/all/taxport_1___11.htmlhttps://www.df.cl/noticias/site/tax/port/all/taxport_1___12"

Thanks in advance!!

0 Answers
Related