Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- StringBuilder whole = new StringBuilder();
- try {
- URL url = new URL(
- "http://rootzwiki.com/forum/362-cdma-galaxy-nexus-developer-forum/");
- HttpURLConnection urlConnection = (HttpURLConnection) url
- .openConnection();
- urlConnection.setRequestProperty("User-Agent", "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2");
- try {
- BufferedReader in = new BufferedReader(
- new InputStreamReader(new BufferedInputStream(
- urlConnection.getInputStream())));
- String inputLine;
- while ((inputLine = in.readLine()) != null)
- whole.append(inputLine);
- in.close();
- } catch (IOException e) {
- Log.e("POC", e.getMessage());
- } finally {
- urlConnection.disconnect();
- }
- } catch (Exception e) {
- Log.e("POC", e.getMessage());
- }
- Document doc = Parser
- .parse(whole.toString(),
- "http://rootzwiki.com/forum/362-cdma-galaxy-nexus-developer-forum/");
- Elements authors = doc.select("a[hovercard-ref]");
- for (Element author : authors) {
- Log.d("POC", author.text() +" " + author.attr("href"));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement