Created
November 16, 2017 22:03
-
-
Save wuerges/b4e1ff4dbbafa9791d875ada2c29fc84 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.aluno_uffs.pdfviewerteste; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import org.jsoup.Jsoup; | |
import org.jsoup.nodes.Document; | |
import org.jsoup.nodes.Element; | |
import org.jsoup.select.Elements; | |
import java.io.IOException; | |
public class ActivityXML extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_pdf); | |
new Thread(new Runnable() { | |
@Override | |
public void run() { | |
final StringBuilder builder = new StringBuilder(); | |
try { | |
Document doc = Jsoup.connect("http://www.uffs.edu.br/campi/chapeco/restaurante_universitario").get(); | |
String title = doc.title(); | |
Elements links = doc.select("a[href]"); | |
builder.append(title).append("\n"); | |
for (Element link : links) { | |
builder.append("\n").append("Link : ").append(link.attr("href")) | |
.append("\n").append("Text : ").append(link.text()); | |
} | |
String s = builder.toString(); | |
System.out.println("de"); | |
} catch (IOException e) { | |
builder.append("Error : ").append(e.getMessage()).append("\n"); | |
} | |
} | |
}).start(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment