Giter Site home page Giter Site logo

twnstock_crawler's Introduction

twnStock_crawler

目前是以Synchronous request 的 libray requests 來coding Request 請不要送過快,流點Thoughput 給別人用,請加delay

Todo List

同時開多個request

1.Get Free Proxy server list
[How to get valid proxy](https://codelike.pro/create-a-crawler-with-rotating-ip-proxy-in-python/) 
2. Send Multiple Request simultaneously
主要 : Asynchronous requests(aiohttp)
    aiohttp : Proxy 目前不支援https, only support http
備案 : Synchronous request + process(requests + multiprocessing) 
    #Multiprocess example
        pool = Pool(4)
        start = time.time()
        #callback get result in order
        results = pool.starmap_async(main_map, [(1,1),(2,2),(3,0),(4,3),(5,3),(6,5),(7,1),(8,0)],callback=show)
        pool.close()
        pool.join()
        
   #starmap_async vs map_async
   #starmap_async : Support multi args
   #map_async  :    can only one args

3. 防止過多的Asynchronous requests

主要 : 利用semaphore 來做限制

twnstock_crawler's People

Contributors

jaylion321 avatar

Watchers

James Cloos avatar  avatar

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.