Go Down

Topic: Reading Webpage data? (Read 694 times) previous topic - next topic

JustXtreme

is there a way for an arduino to search the content of a html page for a particular set of data then react?

PaulS

Quote
is there a way for an arduino to search the content of a html page for a particular set of data then react?

How is it going to get the html page? If you have an ethernet shield, and make a GET request as a client, then the html page will be spooled back, as text, which you can store and search to your hearts desire.

JustXtreme

perfect. that's what i wanted to hear.
thanx

JustXtreme

Can i split data or create any sort of arrays from it?
Exampe
if the output of the page contains a line
Count=4

can i create a variable in arduino from that piece of data.

PaulS

You read one character at a time from the client connection, so you can do whatever you want with that character - append it to a String object (lots of overhead) or put it in a character array (minimal overhead, but more bookkeeping).

Once you have the data, typically resetting the storage after some delimiter is read, such as a carriage return, you can parse the data.

If the entire web page consists of "Count=4", or the portion of interest at least, what does "can i create a variable in arduino from that piece of data" mean? Do you want to store "Count=4" in an array of characters (you can), or are you thinking that you can split it into parts, and create a variable called Count with a value of 4 (you can't, directly)?

Go Up