Hi Folks,
I’m working on something fun with my son who is a soccer fanatic. I’m taking down the squad details from http://uefa.com/uefaeuro for the upcoming European Championships.
$squads = Invoke-WebRequest -Uri "http://www.uefa.com/uefaeuro/season=2016/teams/team=64/squad/index.html" ($squads.ParsedHtml.getElementsByTagName('td')| Where{$_.InnerText}).Innertext
The squad data for each team comes out in a long string of player attributes. It’s not totally unstructured. Although there are no headings, values for Name, Birthdate, Age, Club, Caps, Goals are represented in the data for each player.
Example below.
David McGoldrick
29/11/1987
28
Ipswich
Daryl Murphy
15/03/1983
33
Ipswich
5
Anthony Stokes
25/07/1988
27
Hibernian
Jon Walters
20/09/1983
32
Stoke
10
5
I’m looking to get the returned data into an object for each player.
ConvertFrom-String and PSCustomObject looked promising but I couldn’t pull it off. Is there a PowerShell method to handle this or should I consider a While loop?
Thanks,
Michael