Change Tor IP using Python Stem for web scraping

Published: 19 May 2020
on channel: Tan En De
3,817
79

Change Tor IP during web scraping in Python. Further anonymizing step is to consider changing user-agent in the header. Also, stop tor service when not in use.

Links for the code: https://github.com/endeneer/change-to...

Note: For Windows, here are the steps:
1) There is no need to install Tor service. Just make sure you have the normal Tor Browser installed.
2) Generate HashedControlPassword
- run the command: tor --hash-password YourPasswordhere | more
- in the video I used abc123 as YourPasswordhere
3) Copy the hash, then edit TorBrowser/Browser/TorBrowser/Data/Tor/torrc
- In the torcc file, add in these two lines:
HashedControlPassword paste_the_hash_copied_just_now
CookieAuthentication 1
4) Start Tor Browser
5) Run the python program as in the video
- there are three things to change:
a) Line 9, change the port 9051 to 9151
b) Line 12, change the port 9050 to 9150
c) Line 16, change the password you set (in clear text, not the hashed one)


On this page of the site you can watch the video online Change Tor IP using Python Stem for web scraping with a duration of hours minute second in good quality, which was uploaded by the user Tan En De 19 May 2020, share the link with friends and acquaintances, this video has already been watched 3,817 times on youtube and it was liked by 79 viewers. Enjoy your viewing!