Populating Array With XML Elements
in
Programming Questions
•
1 year ago
Hello,
I've been trying to solve this for sometime now, and I'm stumped. What I'm doing is connecting to the BBC website and pulling the story out of this particular article. I can pull the data from the site fine, what I want to do is populate an array with some info thats being pulled.
- int a;
- int foundIntroLine;
- String Articles[] = new String[10];
- void setup(){
- a = foundIntroLine;
- while(a < bbcPage.length){
- int indexArticle = bbcPage[a].indexOf("<p>");
- int endArticle = bbcPage[a].indexOf("</p>");
- if(indexArticle > 0 && endArticle > 0){
- println("Article: "+bbcPage[a].substring(indexArticle + 3, endArticle));
- }
- a++;
- }
- //now I want to populate Articles[0 - 9] with the bbcPage.substring
- }
The foundIntroLine is a value that is established somewhere else, its where all the article lines start on the web page, bbcPage is an array that uses 'loadStrings' from the BBC URL.
Now, how would I go about populating Articles with the bbcPage.substrings?
Thanks
1