for 0.7.1

pull/584/head
yihua.huang 8 years ago
parent 17d8bfa907
commit 2e35e149be

@ -6,7 +6,7 @@
<version>7</version>
</parent>
<groupId>us.codecraft</groupId>
<version>0.7.0</version>
<version>0.7.1-SNAPSHOT</version>
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<properties>
@ -233,7 +233,7 @@
<version>2.10.4</version>
<configuration>
<encoding>UTF-8</encoding>
<doctitle>WebMagic 0.7.0</doctitle>
<doctitle>WebMagic 0.7.1-SNAPSHOT</doctitle>
<locale>en_US</locale>
</configuration>
<executions>

@ -3,7 +3,7 @@
<parent>
<groupId>us.codecraft</groupId>
<artifactId>webmagic-parent</artifactId>
<version>0.7.0</version>
<version>0.7.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -3,7 +3,7 @@
<parent>
<groupId>us.codecraft</groupId>
<artifactId>webmagic-parent</artifactId>
<version>0.7.0</version>
<version>0.7.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -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+)/.*")

@ -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);
}
}

@ -3,7 +3,7 @@
<parent>
<artifactId>webmagic-parent</artifactId>
<groupId>us.codecraft</groupId>
<version>0.7.0</version>
<version>0.7.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -3,7 +3,7 @@
<parent>
<artifactId>webmagic-parent</artifactId>
<groupId>us.codecraft</groupId>
<version>0.7.0</version>
<version>0.7.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -3,7 +3,7 @@
<parent>
<artifactId>webmagic-parent</artifactId>
<groupId>us.codecraft</groupId>
<version>0.7.0</version>
<version>0.7.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -3,7 +3,7 @@
<parent>
<artifactId>webmagic-parent</artifactId>
<groupId>us.codecraft</groupId>
<version>0.7.0</version>
<version>0.7.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Loading…
Cancel
Save