Public/Get-DeLaatsteBladzijde.ps1
function Get-DeLaatsteBladzijde { Invoke-WebRequest -Uri https://www.nrc.nl/rubriek/de-laatste-bladzijde/ ` | Select-Object -ExpandProperty Links ` | Select-Object -ExpandProperty HRef ` | Where-Object { $_ -like '/nieuws/*' } | ForEach-Object { $Url = "https://www.nrc.nl$($_)" $DateText = (($Url -split '/')[4..6]) -join '-' $Document = ConvertTo-HtmlDocument -Uri $Url [PSCustomObject]@{ PSTypeName = 'UncommonSense.Nrc.Article' Url = $Url Date = [DateTime]::ParseExact($DateText, 'yyyy-MM-dd', $null) Title = ($Document | Select-HtmlNode -CssSelector 'h1[data-flowtype="headline"]').InnerText Body = ($Document | Select-HtmlNode -CssSelector 'div.content p' -All | Select-Object -SkipLast 1).InnerText -join ' ' } } } |