Code Monkey home page Code Monkey logo

eastmoney's People

Contributors

dengzuoheng avatar niehe avatar yddchsc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

guotechfin

eastmoney's Issues

能否解释一下为什么采用ghost?

虽然用ghost的话ajax解决起来舒服很多, 但是用了ghost我就无法假设每次parse的负载是接近的了, 这个项目最终会应用于scrapy-redis类似的分布式架构, parse负载不均衡就要多写好些行代码做负载均衡,

所以说啊, 我想知道你是怎么做出这个决定的, 是传统方法遇到了不可逾越的困难?

为ItemPipeline类添加from_crawler, from_settings工厂方法

比如说

class GeguyaowenPipeline(object):
    def __init__(self, mongo_server, mongo_port):
            #建立连接之类的
            pass

     @classmethod
      def from_crawler(cls, crawler):
             return cls.from_settings(crawler.settings)

       @classmethod
       def from_settings(cls, settings):
            mongo_server = settings.get('MONGO_SERVER','localhost')
            mongo_port = settings.get('MONGO_PORT',27017)
            return cls(mongo_server,mongo_port)

参考: http://doc.scrapy.org/en/latest/topics/item-pipeline.html

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.