Python Forum

Full Version: help to add user agents
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
import os
try:
	from torrequest import TorRequest
except:
	os.system("pip install torrequest && clear")
	from torrequest import TorRequest

with TorRequest(password='Risk1234') as tr:

headers = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"}
a = str(input("URL    - "))
x = int(input("Amount - "))

def run():
	for i in range(x):
		tr.reset_identity()
		response= tr.get(a)
		print(i+1)

run()
after running this code i got some errors. please help me to solve these errors. Exclamation Exclamation
Can you show the errors you are getting, while running the code?
(May-01-2020, 10:50 AM)pyzyx3qwerty Wrote: [ -> ]Can you show the errors you are getting, while running the code?

root@MRT97:~/123(master)# python bot.py
  File "bot.py", line 10
    headers = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"}
          ^
IndentationError: expected an indented block
what is the problem here
As shown your indentation is wrong. Please tend to it