I am trying to retrieve Exchange Rates from Yahoo
$browser = New-Object System.Net.WebClient
$browser.Proxy.Credentials =[System.Net.CredentialCache]::DefaultNetworkCredentials
$url = 'http://finance.yahoo.com/webservice/v1/symbols/allcurrencies/quote'
$xml = New-Object xml
$xml.Load($url)
[xml]$YahooDataDocument = $xml.InnerXml
$YahooDataDocument.List.resources.resource | format-table name,price
But I am unable to get the data as required, I only get:
Name price ---- ----- resource resource resource resource resource . . ..
Try this:
Thing is when you are getting $xml.list.resources.resource it comes as System.Array so you need to deal with every object separately.