catch
1 TopicCatch dates from website
I got this from someone, and for Albania it works like it should. But if i change to for example Germany as country, it gets text and not the correct dates in the date collum. I see that with Germany and some other countries also have a publicholiday and regional class. Any idea how to format this to catch the date correctly for all countries? $uri = 'http://www.officeholidays.com/countries/albania/index.php' $html = Invoke-WebRequest -Uri $uri $table = $html.ParsedHtml.getElementsByTagName('tr') | Where-Object {$_.classname -eq 'holiday'} | Select-Object -exp innerHTML foreach ($t in $table){ [void]($t -match 'SPAN title="(.*?)"') ; $m1 = $Matches[1] [void]($t -match 'tooltip>(.*)') ; $m2 = $Matches[1] [void]($t -match 'remarks>(.*) ') ; $m3 = $Matches[1] [PSCustomObject]@{ Date = $m1 ; Holiday = $m2 Remarks = If ($m2 -ne $m3){$m3}} } # Results Date Holiday Remarks ---- ------- ------- January 01 New Year's Day January 02 Day after New Years Day March 14 Summer Day March 21 Nevruz Spring Festival. PersiSolved1.7KViews0likes2Comments