DeviceType - Scraping text from HTML - how?!


(Darryl) #1

Hello everyone,

I am working on a device type (etherRain), and ran into an issue. I am trying to grab the status from the irrigation controller, and the data returns (in a web browser) like this:

EtherRain Device Status 
un:EtherRain ma: ..... 
ac: XGP44LYS92 
os: RD 
cs: NA 
rz: OK 
ri: 7 
rn: 0 

I need to get the value of os: and ri: as these values indicate if the device is idle, or running, and which zone it is running on.

I have been doing a lot of reading on Json, and scraping, etc… but havnt found how to do this. Being rather new to groovy, I am ultimately just hacking up a solution. Anyone mind giving me some assistance? I will admit, a bigger issue is that I cant seem to get anything to the IDE logs, so I really feel like I am shooting blind…

Thanks!


(Darryl) #2

Interestingly, logging now works for me… so that looks okay.


(Todd Wackford) #3

You’ll need to parse and handle the DOM. I’d google “java dom parsing”.