I'm parsing a webpage, but having difficulty combining into one variable. I'm looking for the most efficient way to do so as well. This is code I have so far. Any help is appreciated.
$WebResponse = Invoke-WebRequest -Uri "https://finviz.com/news.ashx"
$title = ($WebResponse.AllElements | Where {$_.class -match 'nn-tab-link'}).innertext
$time = ($WebResponse.AllElements | Where {$_.class -match 'nn-date'}).innertext
$link = ($WebResponse.AllElements | Where {$_.class -match 'nn-tab-link'}).href
$r = {
[PSCustomObject]@{
{Time(E/T)} = $time
Headline = $title
Link = $link
}
}
$R
Thanks