Advertisement
guyrleech

Scrape images from a URL

May 30th, 2020
514
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ## You may need to play around with the '800' value for some sites - look at the data-widths property in each image for allowed values
  2.  
  3. Invoke-WebRequest -uri "htps://yoururl" | Select-Object -ExpandProperty Images | ForEach-Object{ $uri = $(if( $_.src -match '^http' ) { $_.src } else { $_.'data-src' }) -replace '{width}' , '800' ; $uri ; Invoke-WebRequest -uri $uri -OutFile "$(($uri -split '/')[-1])" }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement