Commit 5706bb90 authored by yihua.huang's avatar yihua.huang

update xsoup to 0.3.1

parent 7586e3d7
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
<dependency> <dependency>
<groupId>us.codecraft</groupId> <groupId>us.codecraft</groupId>
<artifactId>xsoup</artifactId> <artifactId>xsoup</artifactId>
<version>0.2.4</version> <version>0.3.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
......
...@@ -39,11 +39,11 @@ public class HtmlTest { ...@@ -39,11 +39,11 @@ public class HtmlTest {
assertThat(html.links().all()).contains("/xx/xx"); assertThat(html.links().all()).contains("/xx/xx");
} }
@Test(expected = NullPointerException.class) @Test
public void testNthNodesGet(){ public void testNthNodesGet(){
Html html = new Html("<a data-tip=\"p$t$xxx\" href=\"/xx/xx\">xx</a>"); Html html = new Html("<a data-tip=\"p$t$xxx\" href=\"/xx/xx\">xx</a>");
assertThat(html.xpath("//a[1]/@href").get()).isEqualTo("/xx/xx"); assertThat(html.xpath("//a[1]/@href").get()).isEqualTo("/xx/xx");
Selectable selectable = html.xpath("//a[1]").nodes().get(0); Selectable selectable = html.xpath("//a[1]").nodes().get(0);
assertThat(selectable.xpath("@href").get()).isEqualTo("/xx/xx"); assertThat(selectable.xpath("/a/@href").get()).isEqualTo("/xx/xx");
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment