Coder Social home page Coder Social logo

chinastockspider's Introduction

stock

一个基于网易财经的股票爬虫,可以爬取任意股票的所有历史交易数据

基本上只需要输入三个参数:

股票的代码:如601857(**石油)

爬取的起始年份:2007

爬取的结束年份:2016

不用担心某一年份的某一季度数据为空的情况,不会报错,不会存入空数据,会直接跳过。 考虑到之后会用pandas或者别的库处理csv文件,文件名含有中文可能比较麻烦。所以爬取所有数据的爬虫分为两个:只有股票代码 和 股票代码+中文名字。

  • 获取该支股票的所有交易数据并写入以其股票代码命名的csv中 stock2csvALL.py

  • 获取该支股票的所有交易数据并写入以其股票代码和名字命名的csv中 stock2csvALLWithName.py

下面是稍微非主流一些的文件:

  • 获取该支股票的指定年度指定季度的数据并写入csv stock2csv.py

  • 获取该支股票的所有交易数据并写入txt stock2txt.py

chinastockspider's People

Contributors

yangzhedi avatar

Watchers

James Cloos 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.