Pick up news from a specific site

10

At the moment I'm looking for a solution to implement a module in my App to get news from a specific site and show it on the news module screen.

Can anyone tell me a way?

    
asked by anonymous 24.09.2015 / 13:18

1 answer

11

The name of this type of practice is page scraping , a variation of screen scraping a> . According to the Wikipedia page,

  

[..] a technique in which a computer program extracts data from the   output from another program. [...] The key element that   distinguishes the screen scraping from the usual parsing is that the output   being captured was intended to be viewed by a user   human, instead of serving as input to another program [...]   There are a number of synonyms, including: web scraping, page   scraping, web page wrapping and HTML scraping (specific to   webpages).

The example below for Android demonstrates this behavior:

public static void main(String... args) throws Exception {
    Document document = Jsoup.connect("http://pt.stackoverflow.com/questions/88690").get();
    String question = document.select("#question .post-text p").first().text();
    System.out.println(question);
}

The end result is the title extraction of your question, 'Get news from a specific site!'.

Source: Screen scraping (Wikipedia)
#

    

24.09.2015 / 14:50