Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tantalus Site Interface Changes #28

Open
EthanStevensUSGS opened this issue Feb 12, 2019 · 1 comment
Open

Tantalus Site Interface Changes #28

EthanStevensUSGS opened this issue Feb 12, 2019 · 1 comment
Assignees
Labels
bug Something isn't working High Priority

Comments

@EthanStevensUSGS
Copy link
Owner

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")
@EthanStevensUSGS
Copy link
Owner Author

This bug fix is causing yet another bug in which the download can only access data since the update. This is most likely a URL problem that will need to be sorted. The current URL is not pulling in the correct data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working High Priority
Projects
None yet
Development

No branches or pull requests

2 participants