need help to FIX error in power query

Copper Contributor

let
Source = Json.Document(Web.Contents("https://www.nseindia.com/api/option-chain-currency?symbol=USDINR", [Headers=[#"Accept-Encoding"="gzip, deflate", #"Accept-Language"="en-US,en", #"User-Agent"="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 OPR/68.0.3618.206", Cookie=F859B23EBA840E6C5E14032853F73E31~Tm0eN80arDt6tRqd6t+sz3VvzSHjfVoQVZ1EEc8GhkfS7+2BhErJQ7UEfSWhxqx+O8cCacQnOFWW1rT0oxO+1GygXWcPGN0dVId4Ku7OpSp1zzmnfeQI3v1BsZRQ5BMfdtQ8Z6Hfh3bqtysXMeiRN01LwJTf1ZrDzHzHI2DlU6E="]])),
records = Source[records],
data = records[data],
#"Converted to Table" = Table.FromList(data, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"strikePrice", "expiryDate", "CE", "PE"}, {"strikePrice", "expiryDate", "CE", "PE"})
in
#"Expanded Column1"

 

 

there is a error "TOKAN COMMA EXPECTED"

dont know what to do with this code...please help me if possible

1 Reply

@arethiya Must have overlooked your post until now. Tried to connect to the site with your script and notice that the was a quotation mark missing in the Source step. Added on in the Coockie section like so:

Cookie="F859B23EBA8.......

 

Then the "token" error disappeared, but the site didn't accept the connection and timed-out. Perhaps you can fix that yourself.