bigC5012
bigC5012

Reputation: 599

Scanning data from a Website

I was just wondering if it is possible to use a scanner to read data from a website. Its not necessarily a text webpage but there are pictures, clickable links, etc. So How can I only scan the text and not anything else. This is for an app and I would be reading in names which are subject to change. That's why I would like to read them from the website instead of making my own text file and reading it that way. Any help would be great. Thanks

Upvotes: 1

Views: 896

Answers (2)

Arash GM
Arash GM

Reputation: 10395

You can use a technique named Scraping :

Web scraping

Upvotes: 1

Juned Ahsan
Juned Ahsan

Reputation: 68715

You should use jsoup for it. It is easy to parse HTML pages using this tool.

You can get the HTML doc and can traverse the elements as mentioned here:

Document doc = Jsoup.connect("http://en.wikipedia.org/").get();
Elements newsHeadlines = doc.select("#mp-itn b a");

Getting started guide is simple to learn:

Getting started with JSoup

Upvotes: 1

Related Questions