'unable to open browser using tor with selenium and python

it is still showing my IP while browsing how can we use tor-browser here. How can we use tor browser IP using firefox t run the python program and selenium driver?

from selenium.webdriver.firefox.options import Options
from selenium.webdriver.common.proxy import Proxy, ProxyType

proxy = Proxy({
    'proxyType': ProxyType.MANUAL,
    'socksProxy': '127.0.0.1:9050',
    'socksVersion': 5,
})

options = Options()
options.proxy = proxy
#options.binary_location = '/home/furas/bin/tor'  # doesn't work
options.binary_location = '/Applications/Tor Browser.app/Contents/MacOS/firefox'  # works
driver = webdriver.Firefox(executable_path='/Users/rushika/PycharmProjects/seleniumm/geckodriver')

# driver = webdriver.Firefox(options=options)  #  use path to standard `Firefox`

url = 'https://www.google.com/'
url = 'https://icanhazip.com'     # 

driver.get(url) ````


 



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source