Public/Get-MeesmanFundPrice.ps1
function Get-MeesmanFundPrice { $DutchCulture = Get-Culture 'nl-NL' Invoke-WebRequest -Uri 'https://www.meesman.nl/' | Select-Object -ExpandProperty Links | Where-Object HRef -Match '/onze-fondsen/.+' | Select-Object -ExpandProperty HRef | ForEach-Object { "https://meesman.nl$($_)" } | ForEach-Object { $Document = ConvertTo-HtmlDocument -Uri $_ $Cells = $Document | Select-HtmlNode -CssSelector 'table.table-fund-general-information td' -All $Fund = $Document | Select-HtmlNode -CssSelector 'h1' | Get-HtmlNodeText $DateText = $Cells[3] | Select-HtmlNode -CssSelector 'span' | Get-HtmlNodeText $DateText = $DateText -replace '^\(', '' -replace '\)$', '' $Date = [DateTime]::ParseExact($DateText, 'dd-MM-yyyy', $null) $PriceText = $Cells[3] | Get-HtmlNodeText -DirectInnerTextOnly $PriceText = $PriceText -replace '^[\D\s]*', '' $Price = [decimal]::Parse($PriceText, $DutchCulture) [pscustomobject]@{ PSTypeName ='UncommonSense.Meesman.FundPrice' Date = $Date Fund = $Fund Price = $Price } } } |