Public/Get-MarcelVanRoosmalen.ps1
function Get-MarcelVanRoosmalen { Invoke-WebRequest -Uri https://www.nrc.nl/rubriek/marcel-van-roosmalen/ | 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).InnerText -join ' ' } } } |