Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
help to add user agents
#1
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
Reply
#2
Can you show the errors you are getting, while running the code?
pyzyx3qwerty
"The greatest glory in living lies not in never falling, but in rising every time we fall." - Nelson Mandela
Need help on the forum? Visit help @ python forum
For learning more and more about python, visit Python docs
Reply
#3
(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
Reply
#4
As shown your indentation is wrong. Please tend to it
pyzyx3qwerty
"The greatest glory in living lies not in never falling, but in rising every time we fall." - Nelson Mandela
Need help on the forum? Visit help @ python forum
For learning more and more about python, visit Python docs
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020