From 5f34adf938972e235716dff87c8d932dc2595af8 Mon Sep 17 00:00:00 2001 From: GZhY Date: Sun, 9 Apr 2017 21:29:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=20LinksSelector.selectList?= =?UTF-8?q?=20=E7=9A=84=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../us/codecraft/webmagic/selector/LinksSelectorTest.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/webmagic-core/src/test/java/us/codecraft/webmagic/selector/LinksSelectorTest.java b/webmagic-core/src/test/java/us/codecraft/webmagic/selector/LinksSelectorTest.java index 3fcb71b..75a2913 100644 --- a/webmagic-core/src/test/java/us/codecraft/webmagic/selector/LinksSelectorTest.java +++ b/webmagic-core/src/test/java/us/codecraft/webmagic/selector/LinksSelectorTest.java @@ -1,5 +1,6 @@ package us.codecraft.webmagic.selector; +import org.jsoup.Jsoup; import org.junit.Test; import java.util.List; @@ -15,7 +16,12 @@ public class LinksSelectorTest { @Test public void testLinks() throws Exception { - List links = new LinksSelector().selectList(html); + LinksSelector linksSelector = new LinksSelector(); + List links = linksSelector.selectList(html); + System.out.println(links); + + html = "
"; + links = linksSelector.selectList(Jsoup.parse(html, "http://whatever.com/")); System.out.println(links); } }