Skip to content

Instantly share code, notes, and snippets.

@Windos
Created December 22, 2020 01:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Windos/b3c89ff816be6787f567515951321b31 to your computer and use it in GitHub Desktop.
Save Windos/b3c89ff816be6787f567515951321b31 to your computer and use it in GitHub Desktop.
# May need to update the "Chrome Driver", run this from the module path (it's not an imported command)
# .\Selenium-Binary-Updater.ps1
# Start the driver (this is headless so you shouldn't see anything. Do this once.
$StartUri = 'https://www.twitch.tv/'
$Driver = Start-SeChrome -Arguments "incognito" -HideVersionHint -StartURL $StartUri -Quiet -Headless
# Repeat this part for each profile
# Specify the user you're looking for
$UserName = 'WindosNZ'
# Open the profile's about page
Open-SeUrl -Url "https://www.twitch.tv/$UserName/about" -Target $Driver
# Find all the avatars (can include chat for a live streamer), and filter for the BIG one
$Avatar = (Find-SeElement -By Class -Selection 'tw-image-avatar' -Target $Driver).Where({$_.GetAttribute('src') -like '*-300x300.jpeg'})
$AvatarURI = $Avatar.GetAttribute('src')
$AvatarURI
@Windos
Copy link
Author

Windos commented Dec 22, 2020

And when cleaning up:

$Driver.quit()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment