I want to extract the data from the links in the following page using R
: https://uygulama.gtb.gov.tr/BTBBasvuru/Btbler
However, I am not sure how I can access all the following pages and the links on the table as well.
I have tried using the following code:
library(rvest)
library(RSelenium)
library(stringr)
rd <- rsDriver(browser = "chrome")
remDr <- rd$client`
This gave me:
[1] "Connecting to remote server" Could not open chrome browser. Client error message: Undefined error in httr call. httr output: Failed to connect to localhost port 4567 after 2254 ms: Connection refused Check server log for further details. Warning message: In rsDriver(browser = "chrome") : Could not determine server status.
At first, I have tried this but that did not help for the other pages and also with the individual links:
html <- read_html(url)
column_names <- html %>%
html_nodes("tr:first-child th") %>%
html_text()
row_data <- html %>%
html_nodes("tr:not(:first-child)") %>%
html_nodes("td, a") %>%
html_text() %>%
str_trim()
Can you please help me on how I can extract the text and the images for each link?