Advertisement
Sweetening

Pastebin Scraper

Feb 11th, 2024
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. # Define the URL of the Pastebin user profile
  2. $userProfileUrl = "https://pastebin.com/u/Sweetening"
  3.  
  4. # Use Invoke-WebRequest to fetch the content of the user profile page
  5. $response = Invoke-WebRequest -Uri $userProfileUrl
  6.  
  7. # Use a regular expression to find paste links in the HTML content
  8. # This is a very basic and fragile way to parse HTML and might not work correctly if Pastebin's HTML structure changes
  9. $pasteLinks = $response.Content | Select-String -Pattern '/Sweetening/\w+' -AllMatches | ForEach-Object { $_.Matches } | ForEach-Object { $_.Value }
  10.  
  11. # Remove duplicate links if any
  12. $pasteLinks = $pasteLinks | Select-Object -Unique
  13.  
  14. # Output the paste links
  15. $pasteLinks | ForEach-Object {
  16. Write-Output "https://pastebin.com$_"
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement