Having a bit of trouble pulling a value out of a JSON Association here. I am scraping this website: http://www.msn.com/en-us/money/stockdetails/history/fi-126.1.BY.NYS
I want to scrape the closing stock prices for everyday, and using developer tools found the JSON link that stores the data, with the link: http://finance.services.appex.bing.com/Market.svc/ChartDataV5?symbols=\ 126.1.BY.NYS&chartType=1y&isEOD=False&lang=en-US&isCS=true&isVol=true
I've gotten rather close, and have narrowed down the association and keys using this:
res1 = Association[
Import["http://finance.services.appex.bing.com/Market.svc/\
ChartDataV5?symbols=126.1.BY.NYS&chartType=1y&isEOD=False&lang=en-US&\
isCS=true&isVol=true", "JSON"]];
Keys[res1];
data = res1["Series"];
Keys[data];
content = "p" /. data
This block of code essentially returns that the values I am seeking are under the "p" Key, for instance:
{"T" -> 9201600, "P" -> 20.05, "Hp" -> 20.48, "Lp" -> 19.84,
"Op" -> 20.35, "V" -> 3492724}
I want to extract the 20.05 in "p" -> 20.05. There are several "p" values in data, and ideally I would grab all of them and put them into a list.
p
withP
?content = "P" /. data
$\endgroup$