CC3000 HTML Parser

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
2Cubed
 
Posts: 34
Joined: Mon Feb 25, 2013 7:24 pm

CC3000 HTML Parser

Post by 2Cubed »

How can I parse HTML that is retrieved by the CC3000 Shield's example "WebClient" that is using a different address? Thanks!

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: CC3000 HTML Parser

Post by adafruit_support_mike »

The address shouldn't make any difference to the parsing. What are you trying to do?

User avatar
tdicola
 
Posts: 1074
Joined: Thu Oct 17, 2013 9:11 pm

Re: CC3000 HTML Parser

Post by tdicola »

Yeah if you give a little more info on what page or data you're trying to parse I can help give more advice.

In general though I would stick to something quick and dirty which just looks for a specific string value. Read input a character at a time and add it to a fixed length buffer (pushing out the oldest character if the buffer is full), then use various c string functions to search for specific values. Unfortunately on most Arduinos you have very little memory and program space, so implementing a proper parser or using an existing one not made for Arduino is out of the question.

HTML parsing can get really difficult if the webpage you're parsing doesn't encapsulate the data you're after into uniquely identifiable elements too. If you have control over the page being parsed, you can make your life much easier by putting specific classes or identifiers on the values you need to parse and just looking for those as a hint to start capturing values. If you don't have control over the page and it's really tricky to parse, another option might be making a small web app or page to do the parsing for you and output the values in a simple format the arduino can parse--then call your page instead of the real page.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”