We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › use of print((char)inByte); and web page parsing
Page Index Toggle Pages: 1
use of print((char)inByte); and web page parsing (Read 400 times)
use of print((char)inByte); and web page parsing
May 5th, 2006, 11:46pm
 
In the HTTPClient example, the following line prints out the bytes coming in as char

print((char)inByte);

I would like to put all the incoming bytes into an array of char so that I can parse them and look for specific strings from the html page. I'm looking for help with the following questions

1) how do you convert bytes to char?
2) is there an example on parsing data out of web pages?
3) am i going about this all wrong?

any advice welcome, thanks! Smiley

Re: use of print((char)inByte); and web page parsi
Reply #1 - May 6th, 2006, 12:23am
 
If you want to load a webpage and look through the contents, then you probably want something like:

Code:
String[] lines=loadStrings("http://foo.com/bar.html");
String page=join(lines,"\n");
Page Index Toggle Pages: 1