ThePuiu Active Member Licensed User Longtime User Jun 26, 2014 #1 Hi, I need to read from location: http://86.34.188.179:2347/ value of ADC and Temperature. What is the easiest way to do that? Thank you!
Hi, I need to read from location: http://86.34.188.179:2347/ value of ADC and Temperature. What is the easiest way to do that? Thank you!
NJDude Expert Licensed User Longtime User Jun 26, 2014 #2 If the site doesn't offer an API then you will have to "scrape" the page (you can find a sample HERE) but it is not recommended, you could also use the jTidy library. Upvote 0
If the site doesn't offer an API then you will have to "scrape" the page (you can find a sample HERE) but it is not recommended, you could also use the jTidy library.
ThePuiu Active Member Licensed User Longtime User Jun 27, 2014 #3 I tried to read page with HttpJob Code: Copy Dim job As HttpJob job.Initialize("GetHTML", Me) job.download("http://86.34.188.179:2347/") and the result in JobDone is: <html><head> <title>1WireAgent</title> <link rel="stylesheet" type="text/css" href="c.css" /> <script type="text/javascript" src="j.js"></script> </head><body onLoad="timer();setInterval(function () {timer()}, 1000);"> <div id="w"><div id="c"> <div id="t"><center><img src="logo.png" alt="" /><br>1WireAgent</center></div> <form name="SNMPTA"> <h2>Monitored Data</h2> <br> <fieldset> <legend>1Wire Devices</legend> <br> <fieldset> <legend>Greutate Stup</legend> <div class="s"> <div class="l">ADC</div> <span id="g01"></span></div> </fieldset><br> <fieldset> <legend>Temperatura</legend> <div class="s"> <div class="l">Temperature</div> <span id="v02"></span> °C</div> </fieldset><br> <fieldset> <legend>Info</legend> <div class="s"> <div class="l">Config Port</div>8080</div> <div class="s"> <div class="l">Firmware</div><span id="SysDescr"></span></div> </fieldset> <br> <center><a href="http://www.microelemente.ro/">(c)2014 www.microelemente.ro</a></center> <br> <center><a href="http://www.mozilla.com/firefox/">Recommended with Mozilla Firefox</a></center> </form></div></div> </body></html> but the value of temperature is not in there.... Is something wrong in what I'm doing? Upvote 0
I tried to read page with HttpJob Code: Copy Dim job As HttpJob job.Initialize("GetHTML", Me) job.download("http://86.34.188.179:2347/") and the result in JobDone is: <html><head> <title>1WireAgent</title> <link rel="stylesheet" type="text/css" href="c.css" /> <script type="text/javascript" src="j.js"></script> </head><body onLoad="timer();setInterval(function () {timer()}, 1000);"> <div id="w"><div id="c"> <div id="t"><center><img src="logo.png" alt="" /><br>1WireAgent</center></div> <form name="SNMPTA"> <h2>Monitored Data</h2> <br> <fieldset> <legend>1Wire Devices</legend> <br> <fieldset> <legend>Greutate Stup</legend> <div class="s"> <div class="l">ADC</div> <span id="g01"></span></div> </fieldset><br> <fieldset> <legend>Temperatura</legend> <div class="s"> <div class="l">Temperature</div> <span id="v02"></span> °C</div> </fieldset><br> <fieldset> <legend>Info</legend> <div class="s"> <div class="l">Config Port</div>8080</div> <div class="s"> <div class="l">Firmware</div><span id="SysDescr"></span></div> </fieldset> <br> <center><a href="http://www.microelemente.ro/">(c)2014 www.microelemente.ro</a></center> <br> <center><a href="http://www.mozilla.com/firefox/">Recommended with Mozilla Firefox</a></center> </form></div></div> </body></html> but the value of temperature is not in there.... Is something wrong in what I'm doing?
NJDude Expert Licensed User Longtime User Jun 27, 2014 #4 You are not doing anything wrong, the issue is that the value for the temperature seems to be handled by the JavaScript, like I mentioned on my previous post, scraping is not recommended, now you see why. Upvote 0
You are not doing anything wrong, the issue is that the value for the temperature seems to be handled by the JavaScript, like I mentioned on my previous post, scraping is not recommended, now you see why.
DonManfred Expert Licensed User Longtime User Jun 27, 2014 #5 ThePuiu said: I tried to read page with HttpJob Code: Copy Dim job As HttpJob job.Initialize("GetHTML", Me) job.download("http://86.34.188.179:2347/") Click to expand... The values are written to html-code after page downloading by a javascript. This reads the file v.txt and then the values are updated in html... Try downloading Code: Copy Dim job As HttpJob job.Initialize("GetHTML", Me) job.download("http://86.34.188.179:2347/v.txt") [/quote] Upvote 0
ThePuiu said: I tried to read page with HttpJob Code: Copy Dim job As HttpJob job.Initialize("GetHTML", Me) job.download("http://86.34.188.179:2347/") Click to expand... The values are written to html-code after page downloading by a javascript. This reads the file v.txt and then the values are updated in html... Try downloading Code: Copy Dim job As HttpJob job.Initialize("GetHTML", Me) job.download("http://86.34.188.179:2347/v.txt") [/quote]
ThePuiu Active Member Licensed User Longtime User Jun 27, 2014 #6 Thank you DonManfred! You made my day! Upvote 0