GithubHelp home page GithubHelp logo

bradlucas / get-yahoo-quotes-python Goto Github PK

View Code? Open in Web Editor NEW
39.0 9.0 17.0 5 KB

A Python script to download Yahoo quotes using the new cookie authorized site.

License: MIT License

Python 100.00%

get-yahoo-quotes-python's Introduction

get-yahoo-quotes-python

A Python script to download Yahoo quotes which works with the new cookie authorized page.

This repo has an associated blog post available here:

http://blog.bradlucas.com/posts/2017-06-03-yahoo-finance-quote-download-python/

Create a virtual environment

$ virtualenv env
$ source ./env/bin/activiate
$ pip install requests

Usage

Run the script with the symbol you'd like as a parameter. The script will download to a cvs file named with the symbol.

python get-yahoo-quotes.py SYMBOL

get-yahoo-quotes-python's People

Contributors

bradlucas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

get-yahoo-quotes-python's Issues

TypeError: a bytes-like object is required, not 'str'

Hi there! Thank you for the code. I tried to use it but I keep getting this error:

Downloading AAPL to AAPL.csv
Traceback (most recent call last):
File "get-yahoo-quotes.py", line 96, in
download_quotes(symbol)
File "get-yahoo-quotes.py", line 83, in download_quotes
cookie, crumb = get_cookie_crumb(symbol)
File "get-yahoo-quotes.py", line 57, in get_cookie_crumb
cookie, lines = get_page_data(symbol)
File "get-yahoo-quotes.py", line 52, in get_page_data
lines = r.content.strip().replace('}', '\n')
TypeError: a bytes-like object is required, not 'str'

Any idea on what's going on?

How do I set a start and end date

When I try to delete the rows I don't want, it fails to work with PyAlgoTrade... Is there anyway to specify a Start and End date when grabbing the data?

Thanks

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.