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
phuc_tran
Posts: 13
Registered: ‎03-30-2012
My Device: 8830

Download and Parse HTML

I'm a newbie. I'm learning to build BB10.

I want to create a simple app that downloads and parses HTML file from a link (like http://abc.com).

I reasearched networking_dwnld_file sample project but it seems this sample doesn't fit my requirements.

I also searched on internet but I haven't found any good sample.

I appreciate any help here.

 

Thank you.

 

Please use plain text.
Developer
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: Download and Parse HTML

What kind of parsing do you want to do?

 

There's a reason that there are only a handful of Browsers and most of them don't parse the HTML correctly anyway (I'm looking at you Microsoft :smileyhappy:).

 

Are you looking to just take out some of the information, if so what, have you looked to see if the site you are interested in has any REST or open API's already?


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
New Developer
phuc_tran
Posts: 13
Registered: ‎03-30-2012
My Device: 8830

Re: Download and Parse HTML

Thank you for your quick reply. Below are what I need in my app:

 

1. Open app, the app connects to wifi and download a html page (http://abc.com).

2. After downloading, parsing html to get data from some tag.

3. Display above data in my app (a list view).

 

Is it clear?

Please use plain text.
Developer
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: Download and Parse HTML

The trouble with doing it that way is that any slight design change to the web site or web page can make your app unworkable.

 

I've looked at abc.com and they don't seem to have an API to their web services but I only had a quick look, so...

 

If you are looking to do an app similar to an aggregator then you are better off looking at RSS feeds...

 

http://abcnews.go.com/Site/page/rss--3520115

 

There is a sample app called RSS News in the samples that you might like to take a look at...

 

http://developer.blackberry.com/native/sampleapps/


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
New Developer
phuc_tran
Posts: 13
Registered: ‎03-30-2012
My Device: 8830

Re: Download and Parse HTML

Thanks again for your reply,

 

http://abc.com is a sample only.

I'm looking at rssnews sample.

I'm a newbie, so there are a lot of things I need help.

If you agree, please give me your skype id and then you will be my teacher :Clap:

Please use plain text.
Developer
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: Download and Parse HTML

LOL, thanks but I'm going to have to pass on that offer, I have my own code to write. :smileyhappy:

 

However keep posting here whenever you get stuck or don't understand something and I or someone else will try and help you along.


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.