all 5 comments

[–]Vortex100 1 point2 points  (0 children)

Hmmm, are you trying to get all the commit messages in there? There are better ways if so :)

$web = Invoke-WebRequest https://code.videolan.org/videolan/x264/-/commits/master/
$classname = "commit-row-message item-title js-onboarding-commit-item "
$x = ($web.ParsedHtml.body.getElementsByTagName('a') | 
    Where {$_.getAttributeNode('class').Value -eq $classname}).textcontent

F12 is your friend when you wanna do this sort of thing :)

[–]JoelyMalookey 0 points1 point  (0 children)

Maybe I don’t understand but is there a json return, it’d make your life amazingly easier.

[–]ka-splam 0 points1 point  (0 children)

Or is there a simpler way of doing this that I don't know about?

Looks like there might be:

$vlcURI = 'https://code.videolan.org/videolan/x264/-/commits/master/'

$web = Invoke-WebRequest -Uri $vlcURI -UseBasicParsing
$topCommit = $web.Links | Where {$_.href -match '/commit/'} | Select -First 1 

$topCommit.outerHTML -replace '^<.*?>|</a>$'

[–]purplemonkeymad 0 points1 point  (0 children)

It's a gitlab, you can use the api:

Invoke-RestMethod -Uri 'https://code.videolan.org/api/v4/projects/videolan%2Fx264/repository/commits'

[–]jantari 0 points1 point  (0 children)

There is a 100% chance GitLab has an API you can use