Skip to content

Tantalus Site Interface Changes #28

@EthanStevensUSGS

Description

@EthanStevensUSGS

The Tantalus Site had an update to their interface no longer allowing us to use our current download protocol. This update changed the nodes, and therefore the tables avalible to read using read_html and HTMLparse. By looking at the tbls available, our table was now #3 and not #57, so simply we changed the table being read.

 pgsession <-html_session(url)
  pgform    <-html_form(pgsession)[[1]]
  filled_form <- set_values(pgform,
                            "ctl00$cphBody$txtUsername" = "USGSGuest", 
                            "ctl00$cphBody$txtPass" = "TantalusCreek")

  submit_form(pgsession,filled_form)
  Page <- jump_to(pgsession, url)
  HTML_Pre <- read_html(Page,encoding = "", options=('nbsp'=XINCLUDE))  
  HTML<-htmlParse(HTML_Pre)
  tbls <- readHTMLTable(HTML, headers=T, trim=T, as.data.frame = T,row.names=NULL)
  
  df<-tbls[3] #New
  
  df<-data.frame(Reduce(rbind, df))
 
  SCdf<-data.frame(df[,1],df[,2],df[,3],df[,4])
  SCdf[,1]<-as.POSIXct(SCdf[,1], format="%d-%b-%y %I:%M %p")
    
  #Displays Battery Voltage for Admin
  LastUpdate<-nrow(SCdf)
  print(SCdf[LastUpdate,5])
  
  #Drop Temp, Actual Conductivity and Voltage of Battery
  SCDf<-data.frame(SCdf[,1],SCdf[,4])
  
  names(SCDf)<-c("Date-Time(MDT)","SC")

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions