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 5747a2b..dd97a81 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 d915320..d51d257 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 e199b52..9bca199 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 738d4a7..844c775 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 1e9fd52..1f3b2df 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 597a043..5d40d9f 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 9bdd929..735bcf6 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 891a955..b126d9f 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 a8d40d4..ef4d986 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