I have been using the following query for some time to download the data from the website "Nationale loterij" (Belgium). Most of the time the query works fine but sometimes I get the message "server error Section = ResponseHeader Detail = CR must by followed with LF". I've already changed the code with "cookies ignore". This has worked for quite some time but for example today it failed once and worked later in the day.
Power Query:
let
Source = Csv.Document(Web.Contents("https://www.nationale-loterij.be/api/drawresults/Elot/drawresultinfo/exportcsv?startDate=2020-12-01T00:00:00.0000000&endDate=2020-12-31T23:59:59.0000000", [Headers=[cookies="ignore"]]),[Delimiter=";", Columns=8, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}, {"Column4", type text}, {"Column5", type text}, {"Column6", type text}, {"Column7", type text}, {"Column8", type text}}),
#"Removed Top Rows" = Table.Skip(#"Changed Type",1),
#"Promoted Headers" = Table.PromoteHeaders(#"Removed Top Rows", [PromoteAllScalars=true]),
#"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"Datum", type date}, {"Nummer 1", Int64.Type}, {"Nummer 2", Int64.Type}, {"Nummer 3", Int64.Type}, {"Nummer 4", Int64.Type}, {"Nummer 5", Int64.Type}, {"Ster 1", Int64.Type}, {"Ster 2", Int64.Type}}),
#"Kept First Rows" = Table.FirstN(#"Changed Type1",1)
in
#"Kept First Rows"