I was trying to use Tor with Selenium and Python.
But I stumbled on this error: "selenium.common.exceptions.WebDriverException: Message: Failed to decode response from marionette"
this is the code:
from selenium.webdriver import Firefox
from selenium import webdriver
from selenium.webdriver.firefox.service import Service
from selenium.webdriver.firefox.options import Options
profile_path = "C:\\Users\\alest\\Documents\\Tor\\Browser\\TorBrowser\\Data\\Browser\\profile.default"
firefox_options=Options()
firefox_options.set_preference('profile', profile_path)
firefox_options.set_preference('network.proxy.type', 1)
firefox_options.set_preference('network.proxy.socks', '127.0.0.1')
firefox_options.set_preference('network.proxy.socks_port', 9050)
firefox_options.set_preference("network.proxy.socks_remote_dns", False)
firefox_options.binary_location = "C:\\Users\\alest\\Documents\\Tor\\Browser\\firefox.exe"
service = Service("C:\\Users\\alest\\Desktop\\my_project\\B_0_T\\gecko\\geckodriver.exe")
driver = webdriver.Firefox(service=service, options=firefox_options)
driver.get("https://www.amazon.com/")
I'm on Windows 10, Python 3.11.1 64 bit, Selenium 4.15.2, Geckodriver 0.33.0 64 bit, Tor 102.10.0 64 bit
I've already searched about this problem online and on Stackoverflow but all the solutions of the problem that i've found were about people having this problems when running scripts on servers and ram's problem.