Skip to content

Instantly share code, notes, and snippets.

@itsthedoc
Created January 24, 2018 17:08
Show Gist options
  • Select an option

  • Save itsthedoc/baa2826addac7edc16b05539ca4a5e72 to your computer and use it in GitHub Desktop.

Select an option

Save itsthedoc/baa2826addac7edc16b05539ca4a5e72 to your computer and use it in GitHub Desktop.
PowerShell script to parse books.goalkicker.com and download all PDFs
# Get all books from http://books.goalkicker.com/
$links = Invoke-WebRequest http://books.goalkicker.com/ | Select-Object -ExpandProperty links | where {$_.href -notlike "*tweet*"} | Select-Object -ExpandProperty href | Sort-Object
foreach ($l in $links) {
$books = Invoke-WebRequest http://books.goalkicker.com/$l | Select-Object -ExpandProperty links | Where-Object {$_.href -like "*Pro*.pdf" -and $_.href -notlike "about*" } | Select-Object -ExpandProperty href
foreach ($book in $books) {
Invoke-WebRequest http://books.goalkicker.com/$l/$book -OutFile C:\backup\Learnings\$book
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment