Donate to Remove ads

Got a credit card? use our Credit Card & Finance Calculators

Thanks to Rhyd6,eyeball08,Wondergirly,bofh,johnstevens77, for Donating to support the site

Simple Yahoo Price Scrape update

Discussions regarding financial software
kiloran
Lemon Quarter
Posts: 4112
Joined: November 4th, 2016, 9:24 am
Has thanked: 3250 times
Been thanked: 2855 times

Re: Simple Yahoo Price Scrape update

#114188

Postby kiloran » January 30th, 2018, 9:49 am

JMN2 wrote:
However, looking at the Python code, I can't understand what is the letter code that actually tells that the last price or close price is brought in? IIRC, Yahoo has various letter & number combos that represent previous close, and all kinds of information, for instance last price was l1, p was previous close, change c1, open o, day's low g, etc.

Since late last year, Yahoo have discontinued their Finance API which used these letter/number combinations. There is an alternative, which is much more complicated to use: http://lemonfoolfinancialsoftware.weebl ... nload.html

The replacement for Last Price l1 is regularMarketPrice
Previous close is regularMarketPreviousClose

--kiloran

JMN2
Lemon Quarter
Posts: 2156
Joined: November 4th, 2016, 11:21 am
Has thanked: 288 times
Been thanked: 282 times

Re: Simple Yahoo Price Scrape update

#114222

Postby JMN2 » January 30th, 2018, 12:06 pm

kiloran wrote:
JMN2 wrote:
However, looking at the Python code, I can't understand what is the letter code that actually tells that the last price or close price is brought in? IIRC, Yahoo has various letter & number combos that represent previous close, and all kinds of information, for instance last price was l1, p was previous close, change c1, open o, day's low g, etc.

Since late last year, Yahoo have discontinued their Finance API which used these letter/number combinations. There is an alternative, which is much more complicated to use: http://lemonfoolfinancialsoftware.weebl ... nload.html

The replacement for Last Price l1 is regularMarketPrice
Previous close is regularMarketPreviousClose

--kiloran


...which seems to appear only once in the python code, change that and voila! Thank you.

pochisoldi
Lemon Slice
Posts: 943
Joined: November 4th, 2016, 11:33 am
Has thanked: 32 times
Been thanked: 462 times

Re: Simple Yahoo Price Scrape update

#114287

Postby pochisoldi » January 30th, 2018, 4:09 pm

kiloran wrote:Since late last year, Yahoo have discontinued their Finance API which used these letter/number combinations. There is an alternative, which is much more complicated to use: http://lemonfoolfinancialsoftware.weebl ... nload.html


But not as complicated or as slow as scraping a web page to get data.

Using the json data means that my perl cgi "funds scraper" web page now collects five FTSE quotes in about a second, compared to 10 seconds for my previous attempt.

And it means I can add "mucking around with json" to my CV as well.

Thanks for pointing me in the right direction.

PochiSoldi

JMN2
Lemon Quarter
Posts: 2156
Joined: November 4th, 2016, 11:21 am
Has thanked: 288 times
Been thanked: 282 times

Re: Simple Yahoo Price Scrape update

#114292

Postby JMN2 » January 30th, 2018, 4:25 pm

The way I did it I now have "Sheet2" which brings in the previous close prices, both Sheet1 for current prices and Sheet2 are hidden, Sheet1 prices linked to my portfolio where the macro button is, and a new work sheet called Daily Change collates all prices and has both macro buttons too to run them and show the change and in %.

All I had to do was in archive add a copy of the script to python folder where two words were amended (sheet1 and regularMarketPrice), and add one row to Meta file.

Thanks again to Kiloran.

kiloran
Lemon Quarter
Posts: 4112
Joined: November 4th, 2016, 9:24 am
Has thanked: 3250 times
Been thanked: 2855 times

Re: Simple Yahoo Price Scrape update

#114294

Postby kiloran » January 30th, 2018, 4:26 pm

pochisoldi wrote:
kiloran wrote:Since late last year, Yahoo have discontinued their Finance API which used these letter/number combinations. There is an alternative, which is much more complicated to use: http://lemonfoolfinancialsoftware.weebl ... nload.html


But not as complicated or as slow as scraping a web page to get data.

PochiSoldi

Amen to that :D

--kiloran


Return to “Financial Software - Discussion”

Who is online

Users browsing this forum: No registered users and 31 guests