Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>to get a webpage in java you'll find a code on the bottom of this answer.</p> <p>you can use reg-expressions.</p> <p>here's a nice reference </p> <p><a href="http://developer.android.com/reference/java/util/regex/Pattern.html" rel="nofollow">android regex</a></p> <p>but, if the html is well written you can also try with yahoo's yql. it outputs as json or xml so you can grab it really easy after.</p> <p><a href="http://developer.yahoo.com/yql/console/#h=SELECT%20%2a%20FROM%20html%20WHERE%20url=%27http://www.reddit.com%27" rel="nofollow">yahoo yql console</a></p> <p>personalty, I parse them in python or in php because I feel more comfortable in those languages.</p> <p>get webpage: How to use it:</p> <p>Get_Webpage obj = new Get_Webpage("http://your_url_here"); Sting source = obj.get_webpage_source();</p> <hr> <pre><code>public class Get_Webpage { public String parsing_url = ""; public Get_Webpage(String url_2_get){ parsing_url = url_2_get; } public String get_webpage_source(){ HttpClient client = new DefaultHttpClient(); HttpGet request = new HttpGet(parsing_url); HttpResponse response = null; try { response = client.execute(request); } catch (ClientProtocolException e) { } catch (IOException e) { } String html = ""; InputStream in = null; try { in = response.getEntity().getContent(); } catch (IllegalStateException e) { } catch (IOException e) { } BufferedReader reader = new BufferedReader(new InputStreamReader(in)); StringBuilder str = new StringBuilder(); String line = null; try { while((line = reader.readLine()) != null) { str.append(line); } } catch (IOException e) { } try { in.close(); } catch (IOException e) { } html = str.toString(); return html; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload