Use tor in python or Configure tor in python.

Thinks to do.

1) Download tor from this link and install:- 

2) After installing tor you will get Tor Browser folder 
in Tor Browser folder goto:- Tor folder you have search
as shows in the image below link: 

3) copy the all text from this links:-  
Past all code to notepad and save as torrc file name
and before saving you search for ControlPort 9051 and HashedControlPassword Uncomment this two lines 
as show'n in image link below and save the file.

4) Run tor.exe as administrator after running this file Run you need to install this packages.

1) pip install requests -- upgrade
2) pip install requests[socks]
3) pip install stem

5) Run your Python code for example as show'n below.

import requests

def get_tor_session():
    session = requests.session()
    # Tor uses the 9050 port as the default socks port
    session.proxies = {'http': 'socks5://',
                   'https': 'socks5://'}
    return session

# # Make a request through the Tor connection
# IP visible through Tor
session = get_tor_session()
# Above should print an IP different than your public IP

# Following prints your normal public IP



Popular posts from this blog

Lint found fatal errors while assembling a release target.

Windows 7 all Version 64-Bit iso file Download with crack activation. (Google Drive Link)

ViewModelProviders.of(this) is deprecated what to use instead ViewModelProviders.of(this) OR if you don't want to use ViewmodelFactory OR ViewModelProviders error.