//
//
// org.jsoup
// jsoup
// 1.10.3
//
//
//
// junit
// junit
// 4.12
// test
//
//
//
// commons-io
// commons-io
// 2.6
//
//
//
// org.apache.commons
// commons-lang3
// 3.7
//
package day05;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import java.io.File;
import java.io.IOException;
public class jixucheshi {
public static void main(String[] args) throws IOException {
// Selector 选择器查找元素
Document parse = Jsoup.parse(new File("C:\\Users\\LX\\Desktop\\新建文本文档.txt"), "utf-8");
// 通过标签查找元素,比如:span a div
/*Elements select = parse.select("li");
for (Element element : select) {
System.out.println(element.text());
}*/
//#id:通过ID查找元素,比如:#city_bi 需要加#号
//Element element = doc.select("#city bi").first();
/*Element first = parse.select("#mobileclient").first();
System.out.println(first.text());*/
//.class:通过class名称查找元素,比如:.class_a
/*Element first = parse.select(".dropdown").first();
System.out.println(first.text());*/
//[attribute]:利用属性查找元素,比如:[abc] 需要加[] 除了class id 以外的都叫元素
/* Element first = parse.select("[target]").first();
System.out.println(first.text());*/
//[attr=value]:利用属性值来查找元素,比如:[class=s name] 完整的名字
/*Element first = parse.select("[data-sudaclick=nav_app_sports_p]").first();
System.out.println(first.text());*/
}
}