Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import subprocess
- import random
- # List of User Agents in a text file (one per line)
- user_agent_file = "user_agents.txt"
- # Read User Agents from the file
- with open(user_agent_file, "r") as file:
- user_agents = file.read().splitlines()
- # Choose a random User Agent
- random_user_agent = random.choice(user_agents)
- # Use wget with the random User Agent
- url = "https://httpbin.io/user-agent" # Replace with your URL
- command = f'wget --user-agent="{random_user_agent}" {url}'
- subprocess.call(command, shell=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement