爱意满满的作品展示区。
ltebean

在弄一个爬虫框架,类似于 alfred workflow,拖拖拽拽加少量的 script 就可以写出一个爬虫~

  •  1
     
  •   ltebean · Mar 16, 2014 · 4358 views
    This topic created in 4465 days ago, the information mentioned may be changed or developed.
    前两天突发奇想搞了一个爬虫框架,主要思想借鉴了alfred workflow和ios开发里的storyboard。

    目前爬虫的配置都在config.yaml(https://github.com/yucong/spiderman/blob/master/config.yaml)里,demo里从点评的搜索结果页开始爬起,抓取每一家商户的信息

    解释一下这个配置文件:
    component是一个个功能单元,有处理页面的,有把数据持久化到db的
    segue是连接各个component的(to:发送到哪个component,func:把什么数据发过去,通过offer函数)
    比如shopList的两个segue,第一个segue是把下一页的链接也发给自己处理,第二个是把商户页的链接交给shop这个component处理~

    附上项目地址 https://github.com/yucong/spiderman

    目前主要的核心逻辑已经都实现了,就差把配置文件弄成像storyboard那样的可视化编辑了~

    大家有什么好的js库推荐么~
    2 replies    1970-01-01 08:00:00 +08:00
    Comdex
        1
    Comdex  
       Mar 16, 2014
    有木有用golang实现啊?
    ltebean
        2
    ltebean  
    OP
       Mar 16, 2014
    @Comdex 目前是用nodejs实现的 其实逻辑也不复杂 主要就是处理segue这块 在lib下的pageProcessor.js里
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1011 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 23:14 · PVG 07:14 · LAX 16:14 · JFK 19:14
    ♥ Do have faith in what you're doing.