Donate to Remove ads

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

Thanks to Anonymous,bruncher,niord,gvonge,Shelford, for Donating to support the site

Yahoo price scrape has failed

Discussions regarding financial software
Itsallaguess
Lemon Half
Posts: 9129
Joined: November 4th, 2016, 1:16 pm
Has thanked: 4140 times
Been thanked: 10032 times

Re: Yahoo price scrape has failed

#587581

Postby Itsallaguess » May 6th, 2023, 7:34 pm

Urbandreamer wrote:
Unfortunately it sounds like we are unlikely to get a quick fix as the excel "fixes" are just patches bound to fail soon.


Heh...

If we'd given up when the tool needed patching due to a data-source issue, we'd have packed it all in over 10 years ago...

The whole thing's built on patches, and I expect it always will be as that's simply the nature of the game we're in...

Cheers,

Itsallaguess

smokey01
Lemon Pip
Posts: 96
Joined: November 6th, 2016, 8:42 am
Has thanked: 5 times
Been thanked: 16 times

Re: Yahoo price scrape has failed

#587647

Postby smokey01 » May 7th, 2023, 7:44 am

ReformedCharacter wrote:
spiderbill wrote:
Yes, I have three doing that in my portfolio this time round (CSN, UKW, NESF). Strange as they were all working when I set it up the other week.

cheers
Spiderbill

I've been using Google Sheets for some years for my portfolio valuations and as you mention certain shares fail sometimes. I had 3 prices that returned an error on Friday. Usually it doesn't last long, hopefully it will be back to normal next week.

RC


I’m having the same problem with google sheets. Also maybe 2 months ago I noticed one of my shares had fallen by a huge amount but when I investigated I found google sheets was just returning the wrong value. I then compared other share prices and the found minor discrepancies, sometimes returning a slightly higher value than other sources (such as yahoo, Hargreaves Lansdown) and at other times lower values. I have however noticed that the previous days price always matches the other sources.

Gerry557
Lemon Quarter
Posts: 2130
Joined: September 2nd, 2019, 10:23 am
Has thanked: 184 times
Been thanked: 593 times

Re: Yahoo price scrape has failed

#587660

Postby Gerry557 » May 7th, 2023, 9:24 am

Google Finance often fails to display the odd share price. I have a sheet with live prices etc that gets thrown out when it plays up. Clicking on the individual problematic share often shows the correct details. Occasionally it can't find a share for some reason but usually it gets sorted.

Currently UKW is one of those not working on my sheet but can be viewed via the website.

I manually updated the figure on my sheet this weekend to get the info I needed then changed it back to auto update when Google pull their finger out.

Jam1
Posts: 29
Joined: November 15th, 2021, 10:03 pm
Has thanked: 14 times
Been thanked: 12 times

Re: Yahoo price scrape has failed

#587679

Postby Jam1 » May 7th, 2023, 10:29 am

Thank you Itsallaguess that is working for me.

The issue for Excel Data is that I cannot see yield as one of the selectable fields, such as Price etc

GN100
2 Lemon pips
Posts: 151
Joined: November 4th, 2016, 10:14 am
Has thanked: 22 times
Been thanked: 18 times

Re: Yahoo price scrape has failed

#587687

Postby GN100 » May 7th, 2023, 11:03 am

Thanks from me too itsallaguess. It worked for me and your video was a great help. Prices updating now on my HYPTUS and I can link these through to my other sheets

GN

seagles
Lemon Slice
Posts: 496
Joined: August 19th, 2017, 8:37 am
Has thanked: 154 times
Been thanked: 241 times

Re: Yahoo price scrape has failed

#587699

Postby seagles » May 7th, 2023, 11:41 am

Itsallaguess wrote:I've knocked up a 'rough and ready' VBA routine that will use the still-working and recently more reliable v10 API from Yahoo and scrape prices rapidly for the Excel version of HYPTUSS.


Easy to do and worked for me, except I have zcash in there and it defaults to the last price from row before and not "100". As not needed at the moment (use that for year end reporting), pity it will not let me overwrite it. Thanks for the update, much appreciated.

Itsallaguess
Lemon Half
Posts: 9129
Joined: November 4th, 2016, 1:16 pm
Has thanked: 4140 times
Been thanked: 10032 times

Re: Yahoo price scrape has failed

#587702

Postby Itsallaguess » May 7th, 2023, 12:13 pm

seagles wrote:
Itsallaguess wrote:
I've knocked up a 'rough and ready' VBA routine that will use the still-working and recently more reliable v10 API from Yahoo and scrape prices rapidly for the Excel version of HYPTUSS.


Easy to do and worked for me, except I have zcash in there and it defaults to the last price from row before and not "100".

As not needed at the moment (use that for year end reporting), pity it will not let me overwrite it.

Thanks for the update, much appreciated.


Thanks for that - it only needs a tweak to the VBA to cope with ZCASH, and offers me an opportunity at the same time to improve the error-handling a bit, in case the v10 API process is ever fed an invalid ticker.

So this new VBA code can be used to help with both of those issues -

Code: Select all

Private Sub CommandButton17_Click()

Dim lastrow, rowsdown, epic, url_string, http, sResp, price, regexp

Let lastrow = Range("C65536").End(xlUp).Row

' Clear existing price cells so that the user can see the new prices being populated
For rowsdown = 6 To lastrow
    Cells(rowsdown, 5) = ""
Next rowsdown


Set http = CreateObject("MSXML2.ServerXMLHTTP.6.0")

Set regexp = CreateObject("VBScript.RegExp")

For rowsdown = 6 To lastrow

price = "????"

'Set the Epic for the row
epic = Cells(rowsdown, 3)


' Set the Yahoo Finance v10 API URL for the EPIC in each row
Let url_string = "https://query2.finance.yahoo.com/v10/finance/quoteSummary/" & epic & ".l?modules=price"

'Get the Yahoo Finance JSON for the EPIC
With http
    .Open "GET", url_string, False
    .send
    sResp = .responseText
End With
On Error Resume Next


'Find the Yahoo Finance Yield in the returned JSON if it exists
With regexp
        .Pattern = "regularMarketPrice[\s\S]+?fmt"":""(.*?)"""
        If .Execute(sResp).Count > 0 Then
            price = .Execute(sResp)(0).SubMatches(0)
        End If
End With

If epic = "ZCASH" Then price = 100

' Place the v10 API Yahoo share price on the HYP sheet
Cells(rowsdown, 5) = price

Next rowsdown

End Sub


The above improved v10 Yahoo Price API code shown above can be used with the same video and instructions contained in my earlier post, linked below for completeness -

https://www.lemonfool.co.uk/viewtopic.php?f=27&t=38834&start=20#p587459

Thanks as well to the others who've also been reporting success with this tactical fix - good to know it's been helpful.

Cheers,

Itsallaguess

mc2fool
Lemon Half
Posts: 7972
Joined: November 4th, 2016, 11:24 am
Has thanked: 7 times
Been thanked: 3071 times

Re: Yahoo price scrape has failed

#587717

Postby mc2fool » May 7th, 2023, 1:54 pm

Itsallaguess wrote:Thanks as well to the others who've also been reporting success with this tactical fix - good to know it's been helpful.

Indeed and fair enuff, but until an updated version is provided surely it's easier (and more likely to be compatible) to tell folks how to change from the (currently not working) v7 interface to the (still working fine) v6 one. I don't use and haven't looked at HYPTUSS for yonks but I've found a version from 2020 on my system (note to self, must do better at tidying up!) and it's simple-ish enough. This is for the Excel version:

Open the spreadsheet (enable macros, if it asks)
Hold down the Alt key and press F11
In the Visual Basic window that opens, double-click on VBAProject in the panel on the left
Enter the password pleaseletmein ('twas always so ;))
Double click on Microsoft Excel Objects then again on Sheet1
In the menu select Edit -> Replace
For Find What enter /v7/ and for Replace With enter /v6/
Under Search select Current Project
Click Replace All

Close the Replace window and the VB window and try it out (Get Yahoo Prices)

Assuming it works, don't forget to Save. :D

peterh
2 Lemon pips
Posts: 128
Joined: November 4th, 2016, 12:08 pm
Has thanked: 18 times
Been thanked: 37 times

Re: Yahoo price scrape has failed

#587720

Postby peterh » May 7th, 2023, 2:04 pm

ReformedCharacter wrote:
spiderbill wrote:
Yes, I have three doing that in my portfolio this time round (CSN, UKW, NESF). Strange as they were all working when I set it up the other week.

cheers
Spiderbill

I've been using Google Sheets for some years for my portfolio valuations and as you mention certain shares fail sometimes. I had 3 prices that returned an error on Friday. Usually it doesn't last long, hopefully it will be back to normal next week.

RC

It's the same for me for CSN and UKW (though I've only just entered my portfolio into Google Sheets).

CSN throws up an error in the sheet, but you can successfully search for it in the web interface, but it's missing the name (at least at the time of writing!) - https://www.google.com/finance/quote/CSN:LON?hl=en

kempiejon
Lemon Quarter
Posts: 3649
Joined: November 5th, 2016, 10:30 am
Has thanked: 1 time
Been thanked: 1220 times

Re: Yahoo price scrape has failed

#587721

Postby kempiejon » May 7th, 2023, 2:07 pm

I came back to this thread thinking I might set aside half an hour to try out IAAG's suggestion up thread. I dutifully watched the video double checking the thread I see mc2fool's alternative. 2 minutes later my scape is working again. Ta mc2fool.

genou
Lemon Quarter
Posts: 1103
Joined: November 4th, 2016, 1:12 pm
Has thanked: 179 times
Been thanked: 378 times

Re: Yahoo price scrape has failed

#587749

Postby genou » May 7th, 2023, 4:24 pm

simoan wrote:Thank you. I assumed it worked OK and was more interested in what level of data was provided, and if any data available on Yahoo is not available in Excel. My spreadsheet contains a lot of data available on Yahoo, including currency exchange rates, global stock market indices and commodity prices. On the equities front, I invest a lot in UK small caps and so would be interested in how well AIM listed companies are supported, for instance? Given the data is sourced from Refinitiv I would assume UK stocks have good data coversge.

All the best, Si


The info available for a stock is
price; name; ticker; 52 wk hi/lo ; beta; change/change % ; currency; description; exchange / exchange abbreviation; headquarters ( i.e. registered office ) ; hi /low /open/close; industry; instrument type ; last trade time ; market cap ; P/E ; shares outstanding; volume; volume average; year incorporated.

AIM isn't a pond in which I fish. It finds Burford ( although it defaults to US listing, you can force it to XLON ), CVS Group and Fevertree, so I assume they are all there. I can't get it to find an index - it keeps returning funds that track the indices I try, but that may be my ignorance. It doesn't recognise some stuff I thought an M$ product would - e.g. $INX or UKX ( which MS Money recognises ).

staffordian
Lemon Quarter
Posts: 2307
Joined: November 4th, 2016, 4:20 pm
Has thanked: 1909 times
Been thanked: 871 times

Re: Yahoo price scrape has failed

#587760

Postby staffordian » May 7th, 2023, 6:10 pm

seagles wrote:Easy to do and worked for me, except I have zcash in there and it defaults to the last price from row before and not "100". As not needed at the moment (use that for year end reporting), pity it will not let me overwrite it. Thanks for the update, much appreciated.


A quick tip if you ever need to manually enter a price.

Although it will not allow direct entry into the cell, you can enter what you want in a blank cell to the right of where the data is, then copy and paste it into the price cell. Direct entry is not allowed but copy/paste is.

funduffer
Lemon Quarter
Posts: 1345
Joined: November 4th, 2016, 12:11 pm
Has thanked: 124 times
Been thanked: 854 times

Re: Yahoo price scrape has failed

#587806

Postby funduffer » May 8th, 2023, 8:59 am

My HYPTUSS now working thanks to m2fool's /v6/ trick.

I also use the getdata function in my portfolio spreadsheets, which also do not return share prices at the moment.

Is there a simple way to get this function working again?

FD

tramrider
2 Lemon pips
Posts: 129
Joined: November 4th, 2016, 5:09 pm
Has thanked: 152 times
Been thanked: 46 times

Re: Yahoo price scrape has failed

#587848

Postby tramrider » May 8th, 2023, 12:34 pm

mc2fool wrote:Indeed and fair enuff, but until an updated version is provided surely it's easier (and more likely to be compatible) to tell folks how to change from the (currently not working) v7 interface to the (still working fine) v6 one. I don't use and haven't looked at HYPTUSS for yonks but I've found a version from 2020 on my system (note to self, must do better at tidying up!) and it's simple-ish enough. This is for the Excel version:

Open the spreadsheet (enable macros, if it asks)
Hold down the Alt key and press F11
In the Visual Basic window that opens, double-click on VBAProject in the panel on the left
Enter the password pleaseletmein ('twas always so ;))
Double click on Microsoft Excel Objects then again on Sheet1
In the menu select Edit -> Replace
For Find What enter /v7/ and for Replace With enter /v6/
Under Search select Current Project
Click Replace All

Close the Replace window and the VB window and try it out (Get Yahoo Prices)

Assuming it works, don't forget to Save. :D


Is it possible for you or someone else to give a version of this helpful change to use with LibreOffice instead of Excel?

Itsallaguess
Lemon Half
Posts: 9129
Joined: November 4th, 2016, 1:16 pm
Has thanked: 4140 times
Been thanked: 10032 times

Re: Yahoo price scrape has failed

#587851

Postby Itsallaguess » May 8th, 2023, 12:38 pm

tramrider wrote:
Is it possible for you or someone else to give a version of this helpful change to use with LibreOffice instead of Excel?


Fixed revisions for both Excel and LibreOffice versions are on their way, and I expect this thread will be updated when they're available.

Cheers,

Itsallaguess

mc2fool
Lemon Half
Posts: 7972
Joined: November 4th, 2016, 11:24 am
Has thanked: 7 times
Been thanked: 3071 times

Re: Yahoo price scrape has failed

#587852

Postby mc2fool » May 8th, 2023, 12:41 pm

tramrider wrote:
mc2fool wrote:Indeed and fair enuff, but until an updated version is provided surely it's easier (and more likely to be compatible) to tell folks how to change from the (currently not working) v7 interface to the (still working fine) v6 one. I don't use and haven't looked at HYPTUSS for yonks but I've found a version from 2020 on my system (note to self, must do better at tidying up!) and it's simple-ish enough. This is for the Excel version:

Open the spreadsheet (enable macros, if it asks)
Hold down the Alt key and press F11
In the Visual Basic window that opens, double-click on VBAProject in the panel on the left
Enter the password pleaseletmein ('twas always so ;))
Double click on Microsoft Excel Objects then again on Sheet1
In the menu select Edit -> Replace
For Find What enter /v7/ and for Replace With enter /v6/
Under Search select Current Project
Click Replace All

Close the Replace window and the VB window and try it out (Get Yahoo Prices)

Assuming it works, don't forget to Save. :D

Is it possible for you or someone else to give a version of this helpful change to use with LibreOffice instead of Excel?

Maybe someone else but not me. ;) As I said, I don't use HYPTUSS myself and anyway I've never looked at and don't have LibreOffice installed ...

GPhelan
Lemon Pip
Posts: 63
Joined: November 11th, 2016, 7:25 pm
Has thanked: 1 time
Been thanked: 28 times

Re: Yahoo price scrape has failed

#587949

Postby GPhelan » May 8th, 2023, 10:59 pm

Many thanks to mc2fool for the simple update that has restored my own price capture tool.
It is based on the price acquisition code in LivePrice, but modified with custom JSON processing to allow the specification of an exchange code and with considerable extra VBA code to create a data file suitable for import into Quicken.
The one character update took seconds to implement and test, whereas updating the documentation for my future self took far longer!

kiloran
Lemon Quarter
Posts: 4123
Joined: November 4th, 2016, 9:24 am
Has thanked: 3275 times
Been thanked: 2862 times

Re: Yahoo price scrape has failed

#588001

Postby kiloran » May 9th, 2023, 10:27 am

Itsallaguess wrote:
tramrider wrote:
Is it possible for you or someone else to give a version of this helpful change to use with LibreOffice instead of Excel?


Fixed revisions for both Excel and LibreOffice versions are on their way, and I expect this thread will be updated when they're available.

Cheers,

Itsallaguess

HYPTUSS has been updated. See viewtopic.php?p=587999#p587999

--kiloran

daveh
Lemon Quarter
Posts: 2238
Joined: November 4th, 2016, 11:06 am
Has thanked: 418 times
Been thanked: 820 times

Re: Yahoo price scrape has failed

#590909

Postby daveh » May 24th, 2023, 8:13 am

I changed my version of HYPTUSS to the earlier API version and it was working, but it seems to have stopped working again today.

kiloran
Lemon Quarter
Posts: 4123
Joined: November 4th, 2016, 9:24 am
Has thanked: 3275 times
Been thanked: 2862 times

Re: Yahoo price scrape has failed

#590912

Postby kiloran » May 24th, 2023, 8:20 am

daveh wrote:I changed my version of HYPTUSS to the earlier API version and it was working, but it seems to have stopped working again today.

:( :( :(
Same here.
Unless this is a short-term glitch, I think we need to implement the v10 solution suggested by Itsallaguess, and maybe include an alternative

--kiloran


Return to “Financial Software - Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests