Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or download
Notice: Creating folder will generate an empty file .keep, because not support in Git

ci maven

##What is Gecco Gecco is a easy to use lightweight web crawler developed with java language.Gecco integriert jsoup, httpclient, fastjson, spring, htmlunit, redission ausgezeichneten framework,Let you only need to configure a number of jQuery style selector can be very quick to write a crawler.Gecco framework has excellent scalability, the framework based on the principle of open and close design, to modify the closure, the expansion of open.At the same time Gecco is based on a very open MIT open source protocol, whether you are a user or want to jointly improve the Gecco developer, welcome to request pull.If you like the crawler framework,please star or fork!

##Main features

  • Easy to use, use jQuery style selector to extract elements
  • Support for asynchronous Ajax requests in the page
  • Support page JavaScript variable extraction
  • Using Redis to realize distributed crawling,reference gecco-redis
  • Support the development of business logic with Spring,reference gecco-spring
  • Support htmlunit extension,reference gecco-htmlunit
  • Support extension mechanism
  • Support download UserAgent random selection
  • Support the download proxy server randomly selected

##Framework overview 架构图

##Download ###Download via Maven



###Dependent project httpclient,jsoup,fastjson,reflections,cglib,rhino,log4j,jmxutils,commons-lang3

##Quick start

@Gecco(matchUrl="{user}/{project}", pipelines="consolePipeline")
public class MyGithub implements HtmlBean {

    private static final long serialVersionUID = -7127412585200687225L;

    private String user;

    private String project;

    private String title;

    @HtmlField(cssPath=".pagehead-actions li:nth-child(2) .social-count")
    private int star;

    @HtmlField(cssPath=".pagehead-actions li:nth-child(3) .social-count")
    private int fork;

    private String readme;

    public String getReadme() {
        return readme;

    public void setReadme(String readme) {
        this.readme = readme;

    public String getUser() {
        return user;

    public void setUser(String user) {
        this.user = user;

    public String getProject() {
        return project;

    public void setProject(String project) {
        this.project = project;

    public String getTitle() {
        return title;

    public void setTitle(String title) {
        this.title = title;

    public int getStar() {
        return star;

    public void setStar(int star) { = star;

    public int getFork() {
        return fork;

    public void setFork(int fork) {
        this.fork = fork;
    public static void main(String[] args) {

##DynamicGecco The purpose of DynamicGecco is to implement the runtime configuration of the crawl rule without defining the SpiderBean.In fact, the principle is the use of byte code programming, dynamic generation of SpiderBean, but also through the custom GeccoClassLoader to achieve the rule of hot deployment.Below is a simple Demo, more complex Demo can refer to the example below com.geccocrawler.gecco.demo.dynamic.

The following code implements the runtime configuration of the crawl rule:

.gecco("{user}/{project}", "consolePipeline")
.intField("star").csspath(".pagehead-actions li:nth-child(2) .social-count").text(false).build()
.intField("fork").csspath(".pagehead-actions li:nth-child(3) .social-count").text().build()
.stringField("contributors").csspath("ul.numbers-summary > li:nth-child(4) > a").href().build()


You can see that the DynamicGecco way compared to the traditional way of annotation code greatly reduced, and a very cool point is DynamicGecco to support the operation of the definition and modification of rules.

##Demo 教您使用java爬虫gecco抓取JD全部商品信息(一)







##Contact and communication

##License Please follow the open source protocol MIT!

Comments ( 0 )

Sign in for post a comment


易用的轻量化网络爬虫 spread retract


No release




load more
can not load any more