HTTP.get() to retrieve html.


mike72
 Share

Recommended Posts

hello.

Is it possible to retrieve HTML code from the HTTP.get() function?

I am trying to get weather data that is on a HTML page, not an XML. no matter what i do, i cant seem to get the data out of that page.

the string i want to retrieve from that page is : <span id="current-temp-value">19</span><span class="current-temp__unit" id="current-temp-unit">°&#8200;C</span>

from the weather sample, i am using : l1 = find(response, "< + span + id=" + tag + ">",0), and every other possibility between the "".

the error i get is C1000, channel not found.

Could you please tell me where i am going wrong.

thanks

Mike

Link to comment
Share on other sites

1) you have a comment in line 39 that isn't marked as a comment.  Its outside functions in the class, but still will have unpredictable behavior.

2) for some reason you commented out l2 at line 42.  Then you go on to use l2 in line 45 and 46.  This may be where you are getting the C1000 error since l2 never exists.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share