Skip to content

Instantly share code, notes, and snippets.

@robinfang
Created March 12, 2014 02:03
Show Gist options
  • Save robinfang/9499269 to your computer and use it in GitHub Desktop.
Save robinfang/9499269 to your computer and use it in GitHub Desktop.
Jsoup解析
import java.io.IOException;
import org.jsoup.*;
import org.jsoup.nodes.Element;
import org.jsoup.select.*;
public class Parser2 {
/**
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
Elements select = Jsoup.connect("http://robinfang.github.io/")
.get()
.select("body > table:nth-child(1) > tbody > tr:nth-child(4) > td:nth-child(5)");
for (Element element : select) {
System.out.println(element.html());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment