PowerShellで日経平均をスクレイピング

winscript.jp

$url = 'https://www.nikkei.com/markets/kabu/'

$html = (Invoke-Webrequest $url).ParsedHTML

$nikkei = $html.getElementsByTagName("span") | Where-Object { $_.className -eq 'mkc-stock_prices' } | ForEach-Object { $_.innerText }

Write-Host $nikkei

imabari.hateblo.jp

imabari.hateblo.jp

imabari.hateblo.jp

imabari.hateblo.jp