Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Developer
sensationality
Posts: 24
Registered: ‎02-22-2013
My Device: BlackBerry Z10

Data Parsers

Hi, 

I want to get some data from a website for my app, what I have right now is getting the HTML source for the site, and storing it in a QString. Then parsing the QString which gets the specific values I need from the webpage.

 

Problem is, when parsing I'm using things like QString.split, indexOf(), etc, and for this I need multiple nested loops. This causes the program to run really slow (with 3 nested loops).

 

Does anyone have another way of doing this without using String manipulations, to get specific data from a website. Thanks

Developer
kylefowler
Posts: 526
Registered: ‎05-17-2009
My Device: 9900

Re: Data Parsers

Does this website have an api that you could use to get pure xml or json? There is not an easy way to parse html, but you could try to run it through XMLDataAccess and see if it parses it.
Like all of my posts
Developer
Bullety
Posts: 138
Registered: ‎08-02-2009
My Device: Z10

Re: Data Parsers

If there is no other way to access the data you want, using regular expressions would possibly be a better choice.
Have a look at the QRegExp class.
Developer
skyhawk92
Posts: 79
Registered: ‎02-04-2013
My Device: Z10 LE

Re: Data Parsers

[ Edited ]

If you're still here, could you tell, how did you get html source of a website ?