master
yihua.huang 2014-05-27 18:07:53 +08:00
parent 3939074a23
commit a5d1b56e44
1 changed files with 2 additions and 3 deletions

View File

@ -28,8 +28,7 @@ public class SelectorTest {
public void testNodes() throws Exception {
Html selectable = new Html(html);
List<Selectable> links = selectable.xpath("//a").nodes();
for (Selectable link : links) {
System.out.println(link.xpath("/@href"));
}
assertThat(links.get(0).xpath("/@href").get()).isEqualTo("http://whatever.com/aaa");
assertThat(links.get(1).xpath("/@href").get()).isEqualTo("http://whatever.com/bbb");
}
}