search for: read_html

Displaying 15 results from an estimated 15 matches for "read_html".

2017 Jun 22
2
Accessing Pointers
Hello, I am relatively new to R and would like to access the document my pointer is pointing to in the following line of code. Need some help. #install.packages('xml2') library('xml2') pg1 <- read_html("www.msn.com") str(pg1) ptr <- pg1[[2]] [[alternative HTML version deleted]]
2017 Jun 22
0
Accessing Pointers
...m> wrote: > > Hello, > > I am relatively new to R and would like to access the document my pointer "my pointer"? > is pointing to in the following line of code. Need some help. > > #install.packages('xml2') > library('xml2') > pg1 <- read_html("www.msn.com") Error: 'www.msn.com' does not exist in current working directory ('/Users/davidwinsemius'). > str(pg1) > ptr <- pg1[[2]] > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-p...
2018 Jan 23
1
Scraping from different level URLs website
...e (unsuccessfully) written: WB_links <- "http://projects.worldbank.org/country?lang=en&page=projects" WB_proj <- function(x) { Sys.sleep(5) url <- sprintf("http://projects.worldbank.org/search?lang=en&searchTerm=&countrycode_exact=%s", x) html <- read_html(url) tibble(title = html_nodes(html, ".grid_20") %>% html_text(trim = TRUE), project_url = html_nodes(html, ".grid_20") %>% html_attr("href")) } WB_scrape <- map_df(1:5, WB_proj) %>% mutate(study_description = map(project_url,...
2016 Jun 21
2
Problemas con tildes y otros caracteres en R y RStudio
...te, me ha ayudado. Sobre la utilización de la función geocode con ciudades con tilde, me dio Carlos Gil Bellosta anteriormente la idea de utilizar iconv para transformar la cadena de búsqueda a UTF-8, y yo lo utilicé para intentar transformar el output de html_table sin resultado: capitales <- read_html(" https://es.wikipedia.org/wiki/Anexo:Capitales_de_provincia_de_Espa%C3%B1a_por_poblaci%C3%B3n ") capitales <- html_nodes(capitales, "table") capitales <- html_table(capitales[[1]])$Ciudad capitales <- iconv(capitales, to = "UTF-8") En la referencia que me ha...
2016 Jun 21
2
Problemas con tildes y otros caracteres en R y RStudio
...TF-16BE 0.10 6 UTF-16LE 0.10 7 Shift_JIS ja 0.10 8 GB18030 zh 0.10 9 EUC-JP ja 0.10 10 EUC-KR ko 0.10 11 Big5 zh 0.10 He ido probando cada uno de esos encodings, al llamar a la función read_html, pero nada, sigue sin codificarlo bien. También probé a utilizar iconv, pero sin resultados positivos. En fin, seguiré investigando. Muchas gracias y saludos! Jose Ignacio 2016-06-21 12:07 GMT+02:00 Carlos J. Gil Bellosta <cgb en datanalytics.com>: > Hola, ¿qué tal? > > Son los...
2023 Jul 26
1
Downloading a directory of text files into R
...ads all files in the posted link. suppressPackageStartupMessages({ library(rvest) }) # destination directory, change this at will dest_dir <- "~/Temp" # first get the two subfolders from the Data webpage link <- "http://home.brisnet.org.au/~bgreen/Data/" page <- read_html(link) page %>% html_elements("a") %>% html_text() %>% grep("/$", ., value = TRUE) -> sub_folder # create relevant disk sub-directories, if # they do not exist yet for(subf in sub_folder) { d <- file.path(dest_dir, subf) if(!dir.exists(d)) { su...
2016 Jun 21
2
Problemas con tildes y otros caracteres en R y RStudio
...os Gil Bellosta en su blog ( https://www.datanalytics.com/2016/06/20/6602-767-km-alrededor-de-espana-para-visitar-todas-sus-capitales-de-provincia/), me ocurre que al ejecutar el código library(rvest) library(caRtociudad) library(reshape2) library(ggmap) library(plyr) library(TSP) capitales <- read_html(" https://es.wikipedia.org/wiki/Anexo:Capitales_de_provincia_de_Espa%C3%B1a_por_poblaci%C3%B3n ") capitales <- html_nodes(capitales, "table") capitales <- html_table(capitales[[1]])$Ciudad obtengo esto: > capitales [1] "Madrid" "Bar...
2016 Apr 23
2
CRAN package check results tabulated ... wasRe: Number of package in Ubuntu
...as any one of you used the packages on Ubuntu ? > > You can get the status of efforts to compile packages on the various machine avaialbe to CRAN at the CRAN package checks page: > > https://cran.r-project.org/web/checks/check_summary.html > After scraping that page with rvest::read_html I then used `table` to summarize. I posted the full output at the end of this but here are the relevant rows for Debian (for the Ubuntu option) and the Windows platforms tested: > res_tbl $`r-develLinuxx86_64(Debian GCC)` ERROR NOTE NOTE* OK OK* WARN 261 59 4150 28 3994...
2016 Apr 24
0
CRAN package check results tabulated ... wasRe: Number of package in Ubuntu
...he packages on Ubuntu ? >> >> You can get the status of efforts to compile packages on the various machine avaialbe to CRAN at the CRAN package checks page: >> >> https://cran.r-project.org/web/checks/check_summary.html >> > > After scraping that page with rvest::read_html I then used `table` to summarize. I posted the full output at the end of this but here are the relevant rows for Debian (for the Ubuntu option) and the Windows platforms tested: > >> res_tbl > $`r-develLinuxx86_64(Debian GCC)` > > ERROR NOTE NOTE* OK OK* WARN > 2...
2018 Jan 18
0
Web scraping different levels of a website
...ist <- map(.x = 1:417, .f = function(x) { Sys.sleep(5) url <- ("http://catalog.ihsn.org/index.php/catalog#_r=&collection=&country=&dtype=&from=1890&page=1&ps=100&sid=&sk=&sort_by=nation&sort_order=&to=2017&topic=&view=s&vk=") read_html(url) %>% html_nodes(".title a") %>% html_text() %>% as.data.frame() }) %>% do.call(rbind, .) I have repeated the same code in order to get all the data I was interested in and it seems to work perfectly, although is of course a little slow due to the Sys.sleep() thing. My is...
2018 Jan 31
0
Scraping info from a web site?
...m "https://www.battleforthenet.com/scoreboard" into R? ????? I found recommendations for the "rvest" package to "Easily Harvest (Scrape) Web Pages".? I tried the following: URL <- 'https://www.battleforthenet.com/scoreboard/' library(rvest) Bftn <- read_html(URL) str(Bftn) List of 2 ?$ node:<externalptr> ?$ doc :<externalptr> ?- attr(*, "class")= chr [1:2] "xml_document" "xml_node" ?????? However, I don't know what to do with <externalptr>. ????? The "Selectorgadget" vignette with...
2016 Apr 23
0
Number of package in Ubuntu
> On Apr 22, 2016, at 11:51 AM, mylisttech at gmail.com wrote: > > Dear Experts , > > I am using R with Spark on Windows and now there is a need to move to Ubuntu. I wanted to know if most of the packages that are available on windows , would they be available on Ubuntu/Linux? If not can I compile the source code of those package ? Has any one of you used the packages on Ubuntu ?
2016 Apr 22
4
Number of package in Ubuntu
Dear Experts , I am using R with Spark on Windows and now there is a need to move to Ubuntu. I wanted to know if most of the packages that are available on windows , would they be available on Ubuntu/Linux? If not can I compile the source code of those package ? Has any one of you used the packages on Ubuntu ? Thanks in Advance.
2016 Dec 06
2
rvest
Estimados Hace un tiempo que no uso rvest, corrí un código viejo, anda sin problemas, escribo el nuevo y hay algo que me olvide. Básicamente desde el navegador de internet selecciono el xpath, copio y pego este en R, pero me sale el siguiente error. > text <- Pagina.R %>% + html_nodes(xpath='//*[@id="content"]/p')%>% + html_text() >
2020 May 03
2
Fwd: Re: Fwd: Re: Instalar paquetes no disponibles para la versión actual
Hola a todos: Las versiones oficiales de R no son versiones beta, sino versiones "definitivas" convenientemente testadas. Los paquetes disponibles en el servidor de CRAN están testados contra la versión actual de R. Mantenerse en una versión anticuada normalmente conduce a la pérdida de funcionalidad, errores de dependencias entre versiones de paquetes nuevos etc. En R, actualizar