Advertisement
dereksir

Untitled

Sep 11th, 2023 (edited)
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. import subprocess
  2. import random
  3.  
  4. # List of User Agents in a text file (one per line)
  5. user_agent_file = "user_agents.txt"
  6.  
  7. # Read User Agents from the file
  8. with open(user_agent_file, "r") as file:
  9.     user_agents = file.read().splitlines()
  10.  
  11. # Choose a random User Agent
  12. random_user_agent = random.choice(user_agents)
  13.  
  14. # Use wget with the random User Agent
  15. url = "https://httpbin.io/user-agent"  # Replace with your URL
  16. command = f'wget --user-agent="{random_user_agent}" {url}'
  17. subprocess.call(command, shell=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement