Skip to content

Instantly share code, notes, and snippets.

@jrosell
Created August 26, 2024 16:33
Show Gist options
  • Save jrosell/51c95a5301968edb0fabe900a1e6ef58 to your computer and use it in GitHub Desktop.
Save jrosell/51c95a5301968edb0fabe900a1e6ef58 to your computer and use it in GitHub Desktop.
It can login and it can see the first rows, but it can't scroll down.
library(tidyverse)
library(rvest)
sess <- read_html_live("https://analytics.zoho.com/open-view/your-zoho-table")
sess$view()
try({
sess$type("#passwordValue", "yourpassword")
sess$click("#submitButton")
})
header <- sess %>% html_elements("#chTable .zdbColHead")
column_names <- header |> html_text()
column_names <- column_names[column_names != ""]
rows <- sess %>% html_elements("#dTable .zdbDataRowDiv")
data <-
map(rows, \(row){ # row <- rows[[1]]
row_texts <- row %>% html_elements(".zdbDataCell") %>% html_text()
#print(row_texts)
#names(row_texts) <- column_names
if(length(row_texts) >= length(column_names)){
row_texts <- row_texts[1:length(column_names)]
names(row_texts) <- column_names
}
as_tibble_row(row_texts)
}) |>
list_rbind() |>
filter(!is.na(`__ZDBID`))
data |> print()
sess$scroll_into_view("#dTable")
sess$get_scroll_position()
sess$scroll_by(top = 400)
sess$get_scroll_position()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment