Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $url1 = "https://press.anu.edu.au/publications?sort=score&p="
- $url2 = 'https://press.anu.edu.au'
- for($i=0; $i -lt 102;$i++){
- $page = Invoke-WebRequest -Uri $url1+$i
- $links = @()
- $links += $page.Links | Where-Object outerHTML -Like "*Download for free*" | Select-Object href
- foreach ($pdf in $links)
- {
- $url3 = $url2+$pdf.href
- $dload_page = Invoke-WebRequest -Uri $url3
- $dlink = ($dload_page.Links | Where-Object outerHTML -Like "*.pdf*" | Where-Object innerHTML -Like PDF*).href
- $title = $dload_page.ParsedHtml.nameProp
- $filename = $title+".pdf"
- Invoke-WebRequest -Uri $dlink -OutFile "$filename"
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement