HTML Type Provider type error after web page change

Please refer to https://github.com/kevinmcfarlane/CoronavirusAnalyser

You should be able to download and try it.

See Program.fs.

It’s pointing at https://www.worldometers.info/coronavirus/

This used to work a few months ago but now falls over at line 22.

“Expecting Decimal in Total Cases, got North America”

That first row of continents never used to be there, but I’ve no idea how to get around that.

When I tried to compile I got different error:

Here

(getDouble newDeaths)

error:

error FS0001: This expression was expected to have type
    'float'
but here has type
    'Nullable<int>'

FS0001

that is easy to fix:

(newDeaths.GetValueOrDefault() |> float)

Anyway they added “tabs” to the main table (“Europe”,“North America”,“Asia”,“South America”,“Africa”,“Oceania”) that’s probably what affected most. So to get correct csv it have to be taken into account.

Mine compiles as is but just falls over at line 22. So I can’t even get as far as your error.

Previously I’ve had to play around with types when the data in one or more columns has subtly changed.

When I tried running this again the other day it ran without error, even though I hadn’t changed my code. However, the output was screwed up due to an extra starting column and a new inserted column. I fixed that and it’s now OK - until the next time the table changes!

1 Like