Public/Get-SylviaWitteman.ps1
function Get-SylviaWitteman { $DutchCulture = New-Object -TypeName System.Globalization.CultureInfo -ArgumentList 'nl-NL' Invoke-WebRequest -Uri https://www.volkskrant.nl/auteur/Sylvia%20Witteman ` | Select-Object -ExpandProperty Links ` | Select-Object -ExpandProperty HRef ` | Where-Object { $_ -like '/nieuws-achtergrond/*' -or $_ -like '/cultuur-media/*'} | Select-Object -First 1 | ForEach-Object { $Url = "https://volkskrant.nl$($_)" $Content = Invoke-WebRequest -Uri $Url | Select-Object -ExpandProperty Content $Document = ConvertTo-HtmlDocument -Text $Content $DateText = ($Document | Select-HtmlNode -CssSelector 'time span:first-child').InnerText $Date = [DateTime]::ParseExact($DateText, 'd MMMM yyyy', $DutchCulture) $Title = (($Document | Select-HtmlNode -CssSelector 'h1').InnerText | ForEach-Object { $_.Trim()} | Where-Object { $_ }) -join ' ' $Body = (($Document | Select-HtmlNode -CssSelector 'section.artstyle__main--container p').InnerText | ForEach-Object { $_.Trim() } | Where-Object { $_ }) -join ' ' [PSCustomObject][Ordered]@{ PSTypeName = 'UncommonSense.Volkskrant.Article' Url = $Url Date = $Date Title = $Title Body = $Body } } } |