Simple Yahoo Price Scrape update

Discussions regarding financial software
kiloran
Lemon Quarter
Posts: 3865
Joined: November 4th, 2016, 9:24 am

Re: Simple Yahoo Price Scrape update

Post by kiloran »

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: 2169
Joined: November 4th, 2016, 11:21 am

Re: Simple Yahoo Price Scrape update

Post by JMN2 »

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: 832
Joined: November 4th, 2016, 11:33 am

Re: Simple Yahoo Price Scrape update

Post by pochisoldi »

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: 2169
Joined: November 4th, 2016, 11:21 am

Re: Simple Yahoo Price Scrape update

Post by JMN2 »

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: 3865
Joined: November 4th, 2016, 9:24 am

Re: Simple Yahoo Price Scrape update

Post by kiloran »

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

Post Reply

Return to “Financial Software - Discussion”