Skip to content

Instantly share code, notes, and snippets.

@green-coder
Created December 4, 2011 05:30
Show Gist options
  • Select an option

  • Save green-coder/1429289 to your computer and use it in GitHub Desktop.

Select an option

Save green-coder/1429289 to your computer and use it in GitHub Desktop.
Example of how to parse an html file with Jsoup.
import java.io.IOException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
public class App {
public static void main(String[] args) throws IOException {
Document doc = Jsoup.connect ("http://project2612.org/details.php?id=86").get();
Element element = doc.select("td:containsOwn(English Title) + td").first();
System.out.println("English name of the game: " + element.text());
}
}
@green-coder

Copy link
Copy Markdown
Author

This code displays "Quack Shot Starring Donald Duck".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment