pbiecek / archivist

A set of tools for datasets and plots archiving
http://pbiecek.github.io/archivist/
74 stars 9 forks source link

Table Web Scrapping with R #325

Closed chitemerere closed 6 years ago

chitemerere commented 6 years ago

I am trying to web scrap a table wit multiple pages with R using the following code:

library(rvest) library(plyr)

fetchAll <- function(page) { url <- paste0("https://www.zauba.com/export-trimethoprim/fp-zimbabwe/p-", page, "-hs-code.html") url2 <- read_html(url) url3 <- url2%>%html_nodes("table")%>%.[1]%>%html_table(fill = TRUE) url4 <- data.frame(url3) }

allData <- ldply(1:4, fetchAll, .progress="text")

View(allData)

The output only shows the results of the first page only. Please assist

pbiecek commented 6 years ago

is is related with archivist?

pbiecek commented 6 years ago

not related to archivist you may be interested in the harvest package