From 2e35e149befdbde14a5d6e4384f003b72c8f7593 Mon Sep 17 00:00:00 2001 From: "yihua.huang" Date: Mon, 29 May 2017 14:41:49 +0800 Subject: [PATCH] for 0.7.1 --- pom.xml | 4 ++-- webmagic-core/pom.xml | 2 +- webmagic-extension/pom.xml | 2 +- .../java/us/codecraft/webmagic/example/GithubRepo.java | 2 +- .../us/codecraft/webmagic/model/GithubRepoTest.java | 10 ++++++++++ webmagic-samples/pom.xml | 2 +- webmagic-saxon/pom.xml | 2 +- webmagic-scripts/pom.xml | 2 +- webmagic-selenium/pom.xml | 2 +- 9 files changed, 19 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index 5747a2bb..dd97a81d 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ 7 us.codecraft - 0.7.0 + 0.7.1-SNAPSHOT 4.0.0 pom @@ -233,7 +233,7 @@ 2.10.4 UTF-8 - WebMagic 0.7.0 + WebMagic 0.7.1-SNAPSHOT en_US diff --git a/webmagic-core/pom.xml b/webmagic-core/pom.xml index d9153202..d51d2573 100644 --- a/webmagic-core/pom.xml +++ b/webmagic-core/pom.xml @@ -3,7 +3,7 @@ us.codecraft webmagic-parent - 0.7.0 + 0.7.1-SNAPSHOT 4.0.0 diff --git a/webmagic-extension/pom.xml b/webmagic-extension/pom.xml index e199b52e..9bca1990 100644 --- a/webmagic-extension/pom.xml +++ b/webmagic-extension/pom.xml @@ -3,7 +3,7 @@ us.codecraft webmagic-parent - 0.7.0 + 0.7.1-SNAPSHOT 4.0.0 diff --git a/webmagic-extension/src/main/java/us/codecraft/webmagic/example/GithubRepo.java b/webmagic-extension/src/main/java/us/codecraft/webmagic/example/GithubRepo.java index 738d4a7d..844c775f 100644 --- a/webmagic-extension/src/main/java/us/codecraft/webmagic/example/GithubRepo.java +++ b/webmagic-extension/src/main/java/us/codecraft/webmagic/example/GithubRepo.java @@ -19,7 +19,7 @@ import java.util.List; @HelpUrl({"https://github.com/\\w+\\?tab=repositories", "https://github.com/\\w+", "https://github.com/explore/*"}) public class GithubRepo implements HasKey { - @ExtractBy(value = "//h1[@class='entry-title public']/strong/a/text()", notNull = true) + @ExtractBy(value = "//h1[@class='public']/strong/a/text()", notNull = true) private String name; @ExtractByUrl("https://github\\.com/(\\w+)/.*") diff --git a/webmagic-extension/src/test/java/us/codecraft/webmagic/model/GithubRepoTest.java b/webmagic-extension/src/test/java/us/codecraft/webmagic/model/GithubRepoTest.java index 1e9fd525..1f3b2df0 100644 --- a/webmagic-extension/src/test/java/us/codecraft/webmagic/model/GithubRepoTest.java +++ b/webmagic-extension/src/test/java/us/codecraft/webmagic/model/GithubRepoTest.java @@ -1,10 +1,12 @@ package us.codecraft.webmagic.model; import org.junit.Test; +import us.codecraft.webmagic.SimpleHttpClient; import us.codecraft.webmagic.Site; import us.codecraft.webmagic.Task; import us.codecraft.webmagic.downloader.MockGithubDownloader; import us.codecraft.webmagic.pipeline.PageModelPipeline; +import us.codecraft.webmagic.example.GithubRepo; import static org.assertj.core.api.Assertions.assertThat; @@ -24,4 +26,12 @@ public class GithubRepoTest { } }, GithubRepo.class).addUrl("https://github.com/code4craft/webmagic").setDownloader(new MockGithubDownloader()).test("https://github.com/code4craft/webmagic"); } + + @Test + public void test1() throws Exception { + SimpleHttpClient simpleHttpClient = new SimpleHttpClient(); + GithubRepo model = simpleHttpClient.get("https://github.com/code4craft/webmagic",GithubRepo.class); + System.out.println(model); + + } } diff --git a/webmagic-samples/pom.xml b/webmagic-samples/pom.xml index 597a043f..5d40d9f3 100644 --- a/webmagic-samples/pom.xml +++ b/webmagic-samples/pom.xml @@ -3,7 +3,7 @@ webmagic-parent us.codecraft - 0.7.0 + 0.7.1-SNAPSHOT 4.0.0 diff --git a/webmagic-saxon/pom.xml b/webmagic-saxon/pom.xml index 9bdd9299..735bcf6e 100644 --- a/webmagic-saxon/pom.xml +++ b/webmagic-saxon/pom.xml @@ -3,7 +3,7 @@ webmagic-parent us.codecraft - 0.7.0 + 0.7.1-SNAPSHOT 4.0.0 diff --git a/webmagic-scripts/pom.xml b/webmagic-scripts/pom.xml index 891a955d..b126d9f8 100755 --- a/webmagic-scripts/pom.xml +++ b/webmagic-scripts/pom.xml @@ -3,7 +3,7 @@ webmagic-parent us.codecraft - 0.7.0 + 0.7.1-SNAPSHOT 4.0.0 diff --git a/webmagic-selenium/pom.xml b/webmagic-selenium/pom.xml index a8d40d4c..ef4d9866 100644 --- a/webmagic-selenium/pom.xml +++ b/webmagic-selenium/pom.xml @@ -3,7 +3,7 @@ webmagic-parent us.codecraft - 0.7.0 + 0.7.1-SNAPSHOT 4.0.0